diff --git a/dlls/kernel32/resource.c b/dlls/kernel32/resource.c index 52a5f2e4ad4..d66f4aef0c4 100644 --- a/dlls/kernel32/resource.c +++ b/dlls/kernel32/resource.c @@ -52,7 +52,7 @@ static NTSTATUS get_res_nameA( LPCSTR name, UNICODE_STRING *str ) { if (!HIWORD(name)) { - str->Buffer = (LPWSTR)name; + str->Buffer = ULongToPtr(LOWORD(name)); return STATUS_SUCCESS; } if (name[0] == '#') @@ -73,7 +73,7 @@ static NTSTATUS get_res_nameW( LPCWSTR name, UNICODE_STRING *str ) { if (!HIWORD(name)) { - str->Buffer = (LPWSTR)name; + str->Buffer = ULongToPtr(LOWORD(name)); return STATUS_SUCCESS; } if (name[0] == '#') @@ -103,7 +103,7 @@ static BOOL get_res_name_type_WtoA( LPCWSTR name, LPCWSTR type, LPSTR *nameA, LP *nameA = HeapAlloc( GetProcessHeap(), 0, len ); if (*nameA) WideCharToMultiByte( CP_ACP, 0, name, -1, *nameA, len, NULL, NULL ); } - else *nameA = (LPSTR)name; + else *nameA = ULongToPtr(LOWORD(name)); if (HIWORD(type)) { @@ -111,7 +111,7 @@ static BOOL get_res_name_type_WtoA( LPCWSTR name, LPCWSTR type, LPSTR *nameA, LP *typeA = HeapAlloc( GetProcessHeap(), 0, len ); if (*typeA) WideCharToMultiByte( CP_ACP, 0, type, -1, *typeA, len, NULL, NULL ); } - else *typeA = (LPSTR)type; + else *typeA = ULongToPtr(LOWORD(type)); } __EXCEPT_PAGE_FAULT { @@ -1684,11 +1684,11 @@ BOOL WINAPI UpdateResourceA( HANDLE hUpdate, LPCSTR lpType, LPCSTR lpName, UNICODE_STRING TypeW; UNICODE_STRING NameW; if(!HIWORD(lpType)) - TypeW.Buffer = (LPWSTR)lpType; + TypeW.Buffer = ULongToPtr(LOWORD(lpType)); else RtlCreateUnicodeStringFromAsciiz(&TypeW, lpType); if(!HIWORD(lpName)) - NameW.Buffer = (LPWSTR)lpName; + NameW.Buffer = ULongToPtr(LOWORD(lpName)); else RtlCreateUnicodeStringFromAsciiz(&NameW, lpName); ret = UpdateResourceW(hUpdate, TypeW.Buffer, NameW.Buffer, wLanguage, lpData, cbData);