19#define MM_SETMENUHANDLE (WM_USER + 0)
20#define MM_GETMENUHANDLE (WM_USER + 1)
22#define MENU_TYPE_MASK (MF_STRING | MF_BITMAP | MF_OWNERDRAW | MF_SEPARATOR)
24#define MENU_ITEM_TYPE(flags) ((flags) & MENU_TYPE_MASK)
26#define MNS_STYLE_MASK (MNS_NOCHECK|MNS_MODELESS|MNS_DRAGDROP|MNS_AUTODISMISS|MNS_NOTIFYBYPOS|MNS_CHECKORBMP)
28#define MENUITEMINFO_TYPE_MASK \
29 (MFT_STRING | MFT_BITMAP | MFT_OWNERDRAW | MFT_SEPARATOR | \
30 MFT_MENUBARBREAK | MFT_MENUBREAK | MFT_RADIOCHECK | \
31 MFT_RIGHTORDER | MFT_RIGHTJUSTIFY )
33#define TYPE_MASK (MENUITEMINFO_TYPE_MASK | MF_POPUP | MF_SYSMENU)
35#define STATE_MASK (~TYPE_MASK)
37#define MENUITEMINFO_STATE_MASK (STATE_MASK & ~(MF_BYPOSITION | MF_MOUSESELECT))
39#define MII_STATE_MASK (MFS_GRAYED|MFS_CHECKED|MFS_HILITE|MFS_DEFAULT)
42#define IS_STRING_ITEM(flags) (MF_STRING == MENU_ITEM_TYPE(flags))
43#define IS_MAGIC_BITMAP(id) ((id) && ((INT_PTR)(id) < 12) && ((INT_PTR)(id) >= -1))
60#define GET_WORD(ptr) (*(WORD *)(ptr))
63#define GET_DWORD(ptr) (*(DWORD *)(ptr))
87 UINT fallback_pos = 0;
96 if (pItem) pItem = &pItem[*nPos];
114 else if (
item->wID == *nPos)
121 else if (
item->wID == *nPos)
130 *nPos = fallback_pos;
142 if (!
Item)
return -1;
147 if (
i >= Menu->
cItems )
return -1;
160 if ( -1 !=
ret )
return ret;
164 return ( fByPos ) ?
i :
Item->wID;
187 ERR(
"invalid combination of fMask bits used\n");
195 lpmii->hbmpItem = pItem->hbmp;
243 if (lpmii->
cch <=
len + 1)
260 lpmii->hbmpItem = pItem->hbmp;
266 lpmii->
wID = pItem->wID;
318 ERR(
"Wrong window class for Menu!\n");
337 TRACE(
"Menu Class ProcW\n");
437 if(!hSubMenu)
return NULL;
480 TRACE(
"Menu item: [%08x,%08x,%04x,%04x,%S]\n",
490 ERR(
"CreatePopupMenu failed\n");
496 ERR(
"MENUEX_ParseResource failed\n");
505 WARN(
"Converting NULL menu item %04x, type %04x to SEPARATOR\n",
510 }
while (!(resinfo &
MF_END));
546 if (*NewItemA ==
'\b')
594 pmii_out->hbmpItem =
NULL;
600 ERR(
"invalid combination of fMask bits used\n");
617 pmii_out->
fType &= ~MENUITEMINFO_TYPE_MASK;
702 TRACE(
"AMA Handle bitmaps\n");
748 UINT uID = uIDCheckItem;
774 HMENU m_first, m_check;
776 mii.
cbSize =
sizeof( mii);
786 if (!mi_first)
continue;
794 if (!mi_check)
continue;
797 if (m_first != m_check)
continue;
934 if (lpcmi->
fMask & MIM_BACKGROUND)
937 if (lpcmi->
fMask & MIM_HELPID)
940 if (lpcmi->
fMask & MIM_MAXHEIGHT)
943 if (lpcmi->
fMask & MIM_MENUDATA)
946 if (lpcmi->
fMask & MIM_STYLE)
973 if (lpmi->spSubMenu)
return -1;
990 if( lpmii->
cbSize !=
sizeof( mii) &&
997 mii.
cbSize =
sizeof( mii);
1020 if( lpmii->
cbSize !=
sizeof( mii) && lpmii->
cbSize !=
sizeof( mii) -
sizeof ( mii.hbmpItem))
1026 mii.
cbSize =
sizeof( mii);
1045 TRACE(
"(menu=%p, id=%04x, flags=%04x);\n", hMenu, uId,
uFlags);
1077 TRACE(
"menu=%p item=%04x ptr=%p len=%d flags=%04x\n", hMenu, uIDItem, lpString,
nMaxCount, uFlag );
1079 if (lpString &&
nMaxCount) lpString[0] =
'\0';
1089 if (!
text)
return 0;
1093 TRACE(
"A returning %s\n", lpString);
1112 TRACE(
"menu=%p item=%04x ptr=%p len=%d flags=%04x\n", hMenu, uIDItem, lpString,
nMaxCount, uFlag );
1114 if (lpString &&
nMaxCount) lpString[0] =
'\0';
1131 TRACE(
"W returning %S\n", lpString);
1151 if (
IsMenu(hsubmenu))
return hsubmenu;
1199 TRACE(
"Handle bitmaps\n");
1221 TRACE(
"hmenu %p, item %04x, by pos %d, info %p\n", hMenu, uItem, fByPosition, lpmii);
1242 TRACE(
"Handle bitmaps\n");
1268 TRACE(
"hmenu %p, item %04x, by pos %d, info %p\n", hMenu, uItem, fByPosition, lpmii);
1390 ERR(
"Menu template version %d not supported.\n",
version);
1443 TRACE(
"Handle bitmaps\n");
1479 TRACE(
"Handle bitmaps\n");
1507 if (!lpcmi || (lpcmi->cbSize !=
sizeof(
MENUINFO)))
1530 memset ( &uItem, 0,
sizeof(uItem) );
1553 TRACE(
"hmenu %p, item %u, by pos %d, info %p\n",
hmenu,
item, bypos, lpmii);
1601 TRACE(
"hmenu %p, item %u, by pos %d, info %p\n", hMenu, uItem, fByPosition, lpmii);
ACPI_SIZE strlen(const char *String)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define UlongToHandle(ul)
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE Resource
#define ERROR_NOT_ENOUGH_MEMORY
#define ERROR_INVALID_PARAMETER
#define WideCharToMultiByte
static const WCHAR version[]
LPVOID FASTCALL ValidateHandleNoErr(HANDLE hObject, UINT uType)
#define ValidateHwnd(hwnd)
LPVOID FASTCALL ValidateHandle(HANDLE hObject, UINT uType)
static PVOID FASTCALL DesktopPtrToUser(PVOID ptr)
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
static const WCHAR Message[]
#define check(expected, result)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
void WINAPI SHIM_OBJ_NAME() OutputDebugStringA(LPCSTR lpOutputString)
BOOL NTAPI NtUserMessageCall(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ResultInfo, DWORD dwType, BOOL Ansi)
#define UserHMGetHandle(obj)
#define memcpy(s1, s2, n)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
unsigned __int3264 UINT_PTR
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
EXTINLINE HMENU NtUserxCreatePopupMenu(VOID)
EXTINLINE HMENU NtUserxCreateMenu(VOID)
EXTINLINE BOOL NtUserxDrawMenuBar(HWND hWnd)
struct tagMENU * spSubMenu
#define RtlZeroMemory(Destination, Length)
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
struct _LOADMENU_CALLBACK_ARGUMENTS * PLOADMENU_CALLBACK_ARGUMENTS
_In_ DWORD _Out_ _In_ WORD wFlags
_Reserved_ PVOID Reserved
#define ERROR_MENU_ITEM_NOT_FOUND
#define ERROR_INVALID_MENU_HANDLE
#define ERROR_INVALID_WINDOW_HANDLE
BOOL WINAPI SetMenuItemInfoA(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOA)
HMENU WINAPI CreatePopupMenu(void)
BOOL WINAPI SetMenu(_In_ HWND, _In_opt_ HMENU)
#define GetWindowLongPtrW
UINT WINAPI GetMenuState(_In_ HMENU, _In_ UINT, _In_ UINT)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
MENUINFO CONST * LPCMENUINFO
int WINAPI GetMenuStringW(_In_ HMENU hMenu, _In_ UINT uIDItem, _Out_writes_opt_(cchMax) LPWSTR lpString, _In_ int cchMax, _In_ UINT flags)
HMENU WINAPI CreateMenu(void)
BOOL WINAPI SetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
BOOL WINAPI IsMenu(_In_ HMENU)
UINT WINAPI GetMenuItemID(_In_ HMENU, _In_ int)
HMENU WINAPI GetSystemMenu(_In_ HWND, _In_ BOOL)
BOOL WINAPI InsertMenuA(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCSTR)
int WINAPI GetMenuStringA(_In_ HMENU hMenu, _In_ UINT uIDItem, _Out_writes_opt_(cchMax) LPSTR lpString, _In_ int cchMax, _In_ UINT flags)
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
BOOL WINAPI ModifyMenuA(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCSTR)
#define GMDI_GOINTOPOPUPS
BOOL WINAPI InsertMenuItemA(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOA)
BOOL WINAPI DrawMenuBar(_In_ HWND)
BOOL WINAPI RemoveMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
BOOL WINAPI SetMenuInfo(_In_ HMENU, _In_ LPCMENUINFO)
BOOL WINAPI GetMenuInfo(_In_ HMENU, _Inout_ LPMENUINFO)
BOOL WINAPI AppendMenuA(_In_ HMENU, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCSTR)
BOOL WINAPI CheckMenuRadioItem(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT, _In_ UINT)
#define MAKEINTRESOURCEA(i)
BOOL WINAPI DestroyMenu(_In_ HMENU)
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
BOOL WINAPI GetMenuItemInfoA(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOA)
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
HMENU WINAPI LoadMenuIndirectA(_In_ const MENUTEMPLATE *)
BOOL WINAPI ModifyMenuW(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCWSTR)
#define MAKEINTRESOURCEW(i)
LONG WINAPI GetMenuCheckMarkDimensions(void)
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
int WINAPI GetSystemMetrics(_In_ int)
HMENU WINAPI GetMenu(_In_ HWND)
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
struct tagMENUITEMINFOW MENUITEMINFOW
HMENU WINAPI LoadMenuA(_In_opt_ HINSTANCE, _In_ LPCSTR)
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
_Must_inspect_result_ _In_ ULONG Flags
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList