When this code may fail?
Code:
/***********************************************************************
* MENU_CopySysPopup
*
* Return the default system menu.
*/
static HMENU MENU_CopySysPopup(BOOL mdi)
{
static const WCHAR sysmenuW[] =
{'S','Y','S','M','E','N','U',0};
static const WCHAR sysmenumdiW[] =
{'S','Y','S','M','E','N','U','M','D','I',0};
HMENU hMenu = LoadMenuW(user32_module, (mdi ? sysmenumdiW : sysmenuW));
...
I have tried setting "LC_ALL" to "en".
hMenu is always 0 for my test-app [Rolling Eyes]
one good guess is that user32_module==0 if not you can query GetLastError(); and/or track back through the Wine code. What Wine version are you using?
1) user32_module != 0
2) thx for tip about GetLastError()
It gives me 87 which is ERROR_INVALID_PARAMETER according to msdn.
Following down to SetLastError:
Code:
/* implementation of FindResourceExW */
static HRSRC find_resourceW( HMODULE hModule, LPCWSTR type, LPCWSTR name, WORD
lang )
{
NTSTATUS status;
UNICODE_STRING nameW, typeW;
LDR_RESOURCE_INFO info;
const IMAGE_RESOURCE_DATA_ENTRY *entry = NULL;
nameW.Buffer = typeW.Buffer = NULL;
__TRY
{
if ((status = get_res_nameW( name, &nameW )) != STATUS_SUCCESS) goto
done;
if ((status = get_res_nameW( type, &typeW )) != STATUS_SUCCESS) goto
done;
info.Type = (ULONG_PTR)typeW.Buffer;
info.Name = (ULONG_PTR)nameW.Buffer;
info.Language = lang;
status = LdrFindResource_U( hModule, &info, 3, &entry );
done:
if (status != STATUS_SUCCESS) SetLastError(
RtlNtStatusToDosError(status) );
}
__EXCEPT_PAGE_FAULT
{
SetLastError( ERROR_INVALID_PARAMETER );
}
__ENDTRY
Little ?useless? trace - http://pastebin.com/kVJPXLxv#
Is it possible that application shits somehow in resource table of user32?
Thank you for help :)
jackofblades wrote:> 1) user32_module != 0 > 2) thx for tip about GetLastError() > > It gives me 87 which is ERROR_INVALID_PARAMETER according to msdn. >If this is not desired behaviour, then file a bug report in the bugzilla and attach the trace file and your code segment that does not work. James