- Working with Michael Martin to fix the LoadMenu callback bug. MenuName is a variable string buffer and not a pointer. The minimum size is always four bytes. Initialization of the structure, zero out the memory, allowing Intersource check to function as it should. To make it Intersource, use the first word character in the buffer.

svn path=/trunk/; revision=43101
This commit is contained in:
James Tabor 2009-09-21 01:22:32 +00:00
parent bd6fba2037
commit 1ebd555855
2 changed files with 7 additions and 2 deletions

View file

@ -3967,7 +3967,10 @@ User32CallLoadMenuFromKernel(PVOID Arguments, ULONG ArgumentLength)
Common = (PLOADMENU_CALLBACK_ARGUMENTS) Arguments;
Result = (LRESULT)LoadMenuW(Common->hModule, IS_INTRESOURCE(Common->MenuName) ? Common->MenuName : (LPCWSTR)&Common->MenuName);
Result = (LRESULT)LoadMenuW( Common->hModule,
IS_INTRESOURCE(Common->MenuName) ?
MAKEINTRESOURCE(Common->MenuName[0]) :
(LPCWSTR)&Common->MenuName);
return ZwCallbackReturn(&Result, sizeof(LRESULT), STATUS_SUCCESS);
}

View file

@ -662,11 +662,13 @@ co_IntCallLoadMenu( HINSTANCE hModule,
Argument = IntCbAllocateMemory(ArgumentLength);
if (NULL == Argument)
{
DPRINT1("EventProc callback failed: out of memory\n");
DPRINT1("LoadMenu callback failed: out of memory\n");
return 0;
}
Common = (PLOADMENU_CALLBACK_ARGUMENTS) Argument;
// Help Intersource check and MenuName is now 4 bytes + so zero it.
RtlZeroMemory(Common, ArgumentLength);
Common->hModule = hModule;
if (pMenuName->Length)