38 TRACE(
"Desktop W Class Atom! hWnd 0x%x, Msg %d\n", Wnd,
Msg);
46 case WM_DISPLAYCHANGE:
52 TRACE(
"Desktop lResult %d\n", lResult);
79#define COPYS(f,len) MultiByteToWideChar ( CP_THREAD_ACP, 0, pA->f, len, pW->f, len )
80#define COPYN(f) pW->f = pA->f
91 COPYN(lfOutPrecision);
92 COPYN(lfClipPrecision);
94 COPYN(lfPitchAndFamily);
105#define COPYS(f,len) WideCharToMultiByte ( CP_THREAD_ACP, 0, pW->f, len, pA->f, len, NULL, NULL )
106#define COPYN(f) pA->f = pW->f
111 COPYN(lfOrientation);
117 COPYN(lfOutPrecision);
118 COPYN(lfClipPrecision);
120 COPYN(lfPitchAndFamily);
132 return gpsi->aiSysMet[nIndex];
162 ERR(
"Got exception in hooked GetSystemMetrics!\n");
188 case SPI_GETNONCLIENTMETRICS:
190 LPNONCLIENTMETRICSA pnclma = (LPNONCLIENTMETRICSA)pvParam;
191 NONCLIENTMETRICSW nclmw;
192 if(pnclma->cbSize !=
sizeof(NONCLIENTMETRICSA))
197 nclmw.cbSize =
sizeof(NONCLIENTMETRICSW);
203 pnclma->iBorderWidth = nclmw.iBorderWidth;
204 pnclma->iScrollWidth = nclmw.iScrollWidth;
205 pnclma->iScrollHeight = nclmw.iScrollHeight;
206 pnclma->iCaptionWidth = nclmw.iCaptionWidth;
207 pnclma->iCaptionHeight = nclmw.iCaptionHeight;
208 pnclma->iSmCaptionWidth = nclmw.iSmCaptionWidth;
209 pnclma->iSmCaptionHeight = nclmw.iSmCaptionHeight;
210 pnclma->iMenuWidth = nclmw.iMenuWidth;
211 pnclma->iMenuHeight = nclmw.iMenuHeight;
212 LogFontW2A(&(pnclma->lfCaptionFont), &(nclmw.lfCaptionFont));
213 LogFontW2A(&(pnclma->lfSmCaptionFont), &(nclmw.lfSmCaptionFont));
214 LogFontW2A(&(pnclma->lfMenuFont), &(nclmw.lfMenuFont));
215 LogFontW2A(&(pnclma->lfStatusFont), &(nclmw.lfStatusFont));
216 LogFontW2A(&(pnclma->lfMessageFont), &(nclmw.lfMessageFont));
219 case SPI_SETNONCLIENTMETRICS:
221 LPNONCLIENTMETRICSA pnclma = (LPNONCLIENTMETRICSA)pvParam;
222 NONCLIENTMETRICSW nclmw;
223 if(pnclma->cbSize !=
sizeof(NONCLIENTMETRICSA))
228 nclmw.cbSize =
sizeof(NONCLIENTMETRICSW);
229 nclmw.iBorderWidth = pnclma->iBorderWidth;
230 nclmw.iScrollWidth = pnclma->iScrollWidth;
231 nclmw.iScrollHeight = pnclma->iScrollHeight;
232 nclmw.iCaptionWidth = pnclma->iCaptionWidth;
233 nclmw.iCaptionHeight = pnclma->iCaptionHeight;
234 nclmw.iSmCaptionWidth = pnclma->iSmCaptionWidth;
235 nclmw.iSmCaptionHeight = pnclma->iSmCaptionHeight;
236 nclmw.iMenuWidth = pnclma->iMenuWidth;
237 nclmw.iMenuHeight = pnclma->iMenuHeight;
238 LogFontA2W(&(nclmw.lfCaptionFont), &(pnclma->lfCaptionFont));
239 LogFontA2W(&(nclmw.lfSmCaptionFont), &(pnclma->lfSmCaptionFont));
240 LogFontA2W(&(nclmw.lfMenuFont), &(pnclma->lfMenuFont));
241 LogFontA2W(&(nclmw.lfStatusFont), &(pnclma->lfStatusFont));
242 LogFontA2W(&(nclmw.lfMessageFont), &(pnclma->lfMessageFont));
247 case SPI_GETICONMETRICS:
249 LPICONMETRICSA picma = (LPICONMETRICSA)pvParam;
251 if(picma->cbSize !=
sizeof(ICONMETRICSA))
256 icmw.cbSize =
sizeof(ICONMETRICSW);
261 picma->iHorzSpacing = icmw.iHorzSpacing;
262 picma->iVertSpacing = icmw.iVertSpacing;
263 picma->iTitleWrap = icmw.iTitleWrap;
267 case SPI_SETICONMETRICS:
269 LPICONMETRICSA picma = (LPICONMETRICSA)pvParam;
271 if(picma->cbSize !=
sizeof(ICONMETRICSA))
276 icmw.cbSize =
sizeof(ICONMETRICSW);
277 icmw.iHorzSpacing = picma->iHorzSpacing;
278 icmw.iVertSpacing = picma->iVertSpacing;
279 icmw.iTitleWrap = picma->iTitleWrap;
309 RtlInitEmptyAnsiString(&astrWallpaper, pvParam, uiParam);
323 ERR(
"RtlCreateUnicodeStringFromAsciiz failed\n");
326 pvParam = &ustrWallpaper;
385 ERR(
"Got exception in hooked SystemParametersInfoA!\n");
418 ERR(
"Got exception in hooked SystemParametersInfoW!\n");
520 HWINSTA WindowStation,
534 HWINSTA WindowStation,
558 sizeof(*GetThreadConsoleDesktopRequest));
655 if (
pdi)
return pdi->hShellWindow;
static BOOL CALLBACK EnumFunc(_In_ HWND hWnd, _In_ PCWSTR lpszString, _In_ HANDLE hData)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define CSR_CREATE_API_NUMBER(ServerId, ApiId)
#define NT_SUCCESS(StatCode)
#define ERROR_INVALID_PARAMETER
#define EXCEPTION_EXECUTE_HANDLER
BOOL NTAPI NtUserMessageCall(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ResultInfo, DWORD dwType, BOOL Ansi)
BOOL NTAPI NtUserSystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
HWINSTA NTAPI NtUserGetProcessWindowStation(VOID)
#define OBJ_CASE_INSENSITIVE
#define InitializeObjectAttributes(p, n, a, r, s)
#define SPI_GETDESKWALLPAPER
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToAnsiString(PANSI_STRING DestinationString, PUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define _SEH2_EXCEPT(...)
const struct builtin_class_descr DESKTOP_builtin_class
NTSTATUS NTAPI CsrClientCallServer(_Inout_ PCSR_API_MESSAGE ApiMessage, _Inout_opt_ PCSR_CAPTURE_BUFFER CaptureBuffer, _In_ CSR_API_NUMBER ApiNumber, _In_ ULONG DataLength)
LPVOID lpSecurityDescriptor
USER_GET_THREAD_CONSOLE_DESKTOP GetThreadConsoleDesktopRequest
union _USER_API_MESSAGE::@3537 Data
SYSTEMPARAMETERSINFOA SystemParametersInfoA
SYSTEMPARAMETERSINFOW SystemParametersInfoW
GETSYSTEMMETRICS GetSystemMetrics
BOOL WINAPI SetShellWindowEx(HWND, HWND)
BOOL FASTCALL EnumNamesA(HWINSTA WindowStation, NAMEENUMPROCA EnumFunc, LPARAM Context, BOOL Desktops)
BOOL FASTCALL EndUserApiHook(VOID)
BOOL FASTCALL BeginIfHookedUserApiHook(VOID)
VOID WINAPI UserSetLastNTError(IN NTSTATUS Status)
BOOL FASTCALL EnumNamesW(HWINSTA WindowStation, NAMEENUMPROCW EnumFunc, LPARAM Context, BOOL Desktops)
static __inline void LoadUserApiHook()
static __inline PDESKTOPINFO GetThreadDesktopInfo(VOID)
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
HDESK APIENTRY NtUserOpenDesktop(POBJECT_ATTRIBUTES ObjectAttributes, DWORD dwFlags, ACCESS_MASK dwDesiredAccess)
HDESK APIENTRY NtUserGetThreadDesktop(DWORD dwThreadId, HDESK hConsoleDesktop)
HDESK APIENTRY NtUserCreateDesktop(POBJECT_ATTRIBUTES ObjectAttributes, PUNICODE_STRING lpszDesktopDevice, LPDEVMODEW lpdmw, DWORD dwFlags, ACCESS_MASK dwDesiredAccess)
LRESULT WINAPI DesktopWndProcW(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
HDESK WINAPI OpenDesktopA(LPCSTR lpszDesktop, DWORD dwFlags, BOOL fInherit, ACCESS_MASK dwDesiredAccess)
BOOL WINAPI RealSystemParametersInfoA(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
BOOL WINAPI EnumDesktopsA(HWINSTA WindowStation, DESKTOPENUMPROCA EnumFunc, LPARAM Context)
VOID WINAPI LogFontW2A(LPLOGFONTA pA, CONST LOGFONTW *pW)
int WINAPI RealGetSystemMetrics(int nIndex)
BOOL WINAPI SystemParametersInfoA(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
HDESK WINAPI CreateDesktopW(LPCWSTR lpszDesktop, LPCWSTR lpszDevice, LPDEVMODEW pDevmode, DWORD dwFlags, ACCESS_MASK dwDesiredAccess, LPSECURITY_ATTRIBUTES lpsa)
HDESK WINAPI CreateDesktopA(LPCSTR lpszDesktop, LPCSTR lpszDevice, LPDEVMODEA pDevmode, DWORD dwFlags, ACCESS_MASK dwDesiredAccess, LPSECURITY_ATTRIBUTES lpsa)
BOOL WINAPI SetShellWindow(HWND hwndShell)
BOOL WINAPI SetDeskWallpaper(LPCSTR filename)
BOOL WINAPI SystemParametersInfoW(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
VOID WINAPI LogFontA2W(LPLOGFONTW pW, CONST LOGFONTA *pA)
BOOL WINAPI RealSystemParametersInfoW(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
HWND WINAPI GetShellWindow(VOID)
BOOL WINAPI EnumDesktopsW(HWINSTA WindowStation, DESKTOPENUMPROCW EnumFunc, LPARAM Context)
HWINSTA WINAPI GetProcessWindowStation(void)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG _Out_ DEVINFO * pdi
DEVMODEW *WINAPI GdiConvertToDevmodeW(const DEVMODEA *)
struct tagLOGFONTA * LPLOGFONTA
@ UserpGetThreadConsoleDesktop
#define USERSRV_SERVERDLL_INDEX
HDESK WINAPI GetThreadDesktop(_In_ DWORD)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_QUERYNEWPALETTE
HDC WINAPI GetWindowDC(_In_opt_ HWND)
HDESK WINAPI OpenDesktopW(_In_ LPCWSTR, _In_ DWORD, _In_ BOOL, _In_ DWORD)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define SPI_SETDESKWALLPAPER
NAMEENUMPROCW DESKTOPENUMPROCW
#define WM_PALETTECHANGED
BOOL WINAPI PaintDesktop(_In_ HDC)
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define SPI_GETICONTITLELOGFONT
#define WM_SYSCOLORCHANGE
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define SPI_SETICONTITLELOGFONT
NAMEENUMPROCA DESKTOPENUMPROCA
int WINAPI GetSystemMetrics(_In_ int)