From 1a27fe6b1a3255c1b47859966a0d0145c274e096 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sat, 13 Mar 1999 12:49:31 +0000 Subject: [PATCH] Mask out the upper 12 bits from the resourceid, just like win95 does. --- loader/resource.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/loader/resource.c b/loader/resource.c index 54588a3f948..09a5d198d73 100644 --- a/loader/resource.c +++ b/loader/resource.c @@ -856,7 +856,9 @@ INT WINAPI LoadStringW( HINSTANCE instance, UINT resource_id, TRACE(resource, "instance = %04x, id = %04x, buffer = %08x, " "length = %d\n", instance, (int)resource_id, (int) buffer, buflen); - hrsrc = FindResourceW( instance, (LPCWSTR)((resource_id>>4)+1), + /* Use bits 4 - 19 (incremented by 1) as resourceid, mask out + * 20 - 31. */ + hrsrc = FindResourceW( instance, (LPCWSTR)(((resource_id>>4)&0xffff)+1), RT_STRINGW ); if (!hrsrc) return 0; hmem = LoadResource( instance, hrsrc );