mirror of
https://github.com/reactos/reactos.git
synced 2025-04-06 05:34:22 +00:00
[SHIMENG] Find shims case-insensitive
CORE-15845
This commit is contained in:
parent
cdc8b721da
commit
0ebeced143
4 changed files with 14 additions and 5 deletions
|
@ -19,7 +19,7 @@ typedef FARPROC(WINAPI* GETPROCADDRESSPROC)(HMODULE hModule, LPCSTR lpProcName);
|
|||
typedef BOOL (WINAPI* FREELIBRARYPROC)(HINSTANCE hLibModule);
|
||||
|
||||
|
||||
#define SHIM_NS ForceDxSetupSuccess
|
||||
#define SHIM_NS ForceDXSetupSuccess
|
||||
#include <setup_shim.inl>
|
||||
|
||||
|
||||
|
|
|
@ -69,9 +69,9 @@ PCSTR ShimLib_StringDuplicateA(PCSTR szString)
|
|||
return ShimLib_StringNDuplicateA(szString, lstrlenA(szString) + 1);
|
||||
}
|
||||
|
||||
BOOL ShimLib_StrAEqualsW(PCSTR szString, PCWSTR wszString)
|
||||
BOOL ShimLib_StrAEqualsWNC(PCSTR szString, PCWSTR wszString)
|
||||
{
|
||||
while (*szString == *wszString)
|
||||
while (toupper(*szString) == towupper(*wszString))
|
||||
{
|
||||
if (!*szString)
|
||||
return TRUE;
|
||||
|
@ -116,7 +116,7 @@ PHOOKAPI WINAPI ShimLib_GetHookAPIs(IN LPCSTR szCommandLine, IN LPCWSTR wszShimN
|
|||
{
|
||||
if (ps->GetHookAPIs != NULL && ps->ShimName != NULL)
|
||||
{
|
||||
if (ShimLib_StrAEqualsW(ps->ShimName, wszShimName))
|
||||
if (ShimLib_StrAEqualsWNC(ps->ShimName, wszShimName))
|
||||
{
|
||||
pUsedShim shim = (pUsedShim)ShimLib_ShimMalloc(sizeof(UsedShim));
|
||||
shim->pShim = ps;
|
||||
|
|
|
@ -27,7 +27,7 @@ PVOID ShimLib_ShimMalloc(SIZE_T dwSize);
|
|||
VOID ShimLib_ShimFree(PVOID pData);
|
||||
PCSTR ShimLib_StringDuplicateA(PCSTR szString);
|
||||
PCSTR ShimLib_StringNDuplicateA(PCSTR szString, SIZE_T stringLength);
|
||||
BOOL ShimLib_StrAEqualsW(PCSTR szString, PCWSTR wszString);
|
||||
BOOL ShimLib_StrAEqualsWNC(PCSTR szString, PCWSTR wszString);
|
||||
HINSTANCE ShimLib_Instance(VOID);
|
||||
|
||||
/* Forward events to generic handlers */
|
||||
|
|
|
@ -53,6 +53,15 @@ static expect_shim_data data[] =
|
|||
{ "KERNEL32.DLL", "VerifyVersionInfoW" },
|
||||
}
|
||||
},
|
||||
/* Show that it is not case sensitive */
|
||||
{
|
||||
L"VeRiFyVeRsIoNInFoLiTe",
|
||||
0,
|
||||
{
|
||||
{ "KERNEL32.DLL", "VerifyVersionInfoA" },
|
||||
{ "KERNEL32.DLL", "VerifyVersionInfoW" },
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
static DWORD count_shims(expect_shim_data* data)
|
||||
|
|
Loading…
Reference in a new issue