diff options
author | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
---|---|---|
committer | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
commit | e611b132f9b8abe35b362e5870b74bce94a1e58e (patch) | |
tree | a5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/mvdm/wow32/wres32.c | |
download | NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2 NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip |
Diffstat (limited to 'private/mvdm/wow32/wres32.c')
-rw-r--r-- | private/mvdm/wow32/wres32.c | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/private/mvdm/wow32/wres32.c b/private/mvdm/wow32/wres32.c new file mode 100644 index 000000000..f5dd30b0d --- /dev/null +++ b/private/mvdm/wow32/wres32.c @@ -0,0 +1,126 @@ +/*++ + * + * WOW v1.0 + * + * Copyright (c) 1991, Microsoft Corporation + * + * WRES32.C + * WOW32 16-bit resource support + * + * History: + * Created 11-Mar-1991 by Jeff Parsons (jeffpar) +--*/ + + +#include "precomp.h" +#pragma hdrstop + +MODNAME(wres32.c); + +HANDLE APIENTRY W32FindResource(HANDLE hModule, LPCSTR lpType, LPCSTR lpName, WORD wLang) +{ + PRES p; + + // + // If hModule is not ours, then make Win32 call and return the + // result to USER. + // + + if (LOWORD (hModule) == 0) { + return (FindResourceEx(hModule, lpType, lpName, wLang)); + } + else { + WOW32ASSERT(GETHMOD16(hModule)); + p = FindResource16(GETHMOD16(hModule), (LPSTR)lpName, (LPSTR)lpType); + return HRES32(p); + } + +} + +HANDLE APIENTRY W32LoadResource(HANDLE hModule, HANDLE hResInfo) +{ + PRES p; + + // + // If hModule is not ours, then make Win32 call and return the + // result to USER. + // + + if (ISINST16(hModule) && ISRES16(hResInfo)) { + WOW32ASSERT(GETHMOD16(hModule)); + p = LoadResource16(GETHMOD16(hModule), GETHRES16(hResInfo)); + return HRES32(p); + } + else { + return LoadResource(hModule, hResInfo); + } +} + + +BOOL APIENTRY W32FreeResource(HANDLE hResData, HANDLE hModule) +{ + + // + // If hModule is not ours, then make Win32 call and return the + // result to USER. + // + + if ((LOWORD (hModule) != 0) && ISRES16(hResData)) { + return FreeResource16(GETHRES16(hResData)); + } + else { + return (FreeResource(hResData)); + } +} + + +LPSTR APIENTRY W32LockResource(HANDLE hResData, HANDLE hModule) +{ + + // + // If hModule is not ours, then make Win32 call and return the + // result to USER. + // + + if ((LOWORD (hModule) != 0) && ISRES16(hResData)) { + return LockResource16(GETHRES16(hResData)); + } + else { + return (LockResource(hResData)); + } +} + + +BOOL APIENTRY W32UnlockResource(HANDLE hResData, HANDLE hModule) +{ + + // + // If hModule is not ours, then make Win32 call and return the + // result to USER. + // + + if ((LOWORD (hModule) != 0) && ISRES16(hResData)) { + return UnlockResource16(GETHRES16(hResData)); + } + else { + return (UnlockResource(hResData)); + } +} + + +DWORD APIENTRY W32SizeofResource(HANDLE hModule, HANDLE hResInfo) +{ + + // + // If hModule is not ours, then make Win32 call and return the + // result to USER. + // + + if ((LOWORD (hModule) != 0) && ISINST16(hModule) && ISRES16(hResInfo)) { + WOW32ASSERT(GETHMOD16(hModule)); + return SizeofResource16(GETHMOD16(hModule), GETHRES16(hResInfo)); + } + else { + return (SizeofResource(hModule, hResInfo)); + } +} |