- Removed NtUserGetSystemMetric, updated all related.
- Add GetConnected, this is needed, sometimes global pointers are initilized with zeros. This is normal.
- Fix prototype for NtUserDragDetect, and add the Esc key hit to DragDetect.
svn path=/trunk/; revision=34370
PWINDOW FASTCALL GetThreadDesktopWnd(VOID);
PVOID FASTCALL ValidateHandleNoErr(HANDLE handle, UINT uType);
PWINDOW FASTCALL ValidateHwndNoErr(HWND hwnd);
+VOID FASTCALL GetConnected(VOID);
int STDCALL
GetSystemMetrics(int nIndex)
{
+ GetConnected();
// FIXME("Global Sever Data -> %x\n",g_psi);
if (nIndex < 0 || nIndex >= SM_CMETRICS) return 0;
- if (g_psi)
- return g_psi->SystemMetrics[nIndex];
- else
- return(NtUserGetSystemMetrics(nIndex));
+ return g_psi->SystemMetrics[nIndex];
}
return TRUE;
}
+
+
+VOID
+FASTCALL
+GetConnected(VOID)
+{
+ PW32PROCESSINFO pi;
+
+ if ((PW32THREADINFO)NtCurrentTeb()->Win32ThreadInfo == NULL)
+ NtUserGetThreadState(THREADSTATE_GETTHREADINFO);
+
+ if (g_pi && g_kpi && g_psi) return;
+
+ pi = GetW32ProcessInfo();
+ if (!g_pi) g_pi = pi;
+ if (!g_kpi) g_kpi = SharedPtrToKernel(pi);
+ if (!g_psi) g_psi = SharedPtrToUser(pi->psi);
+ if (!g_psi) { WARN("Global Share Information has not been initialized!\n"); }
+ if (!gHandleTable) gHandleTable = SharedPtrToUser(pi->UserHandleTable);
+ if (!gHandleEntries) gHandleEntries = SharedPtrToUser(gHandleTable->handles);
+
+}
POINT pt)
{
#if 0
- return NtUserDragDetect(hWnd, pt.x, pt.y);
+ return NtUserDragDetect(hWnd, pt);
#else
MSG msg;
RECT rect;
POINT tmp;
- ULONG dx = NtUserGetSystemMetrics(SM_CXDRAG);
- ULONG dy = NtUserGetSystemMetrics(SM_CYDRAG);
+ ULONG dx = GetSystemMetrics(SM_CXDRAG);
+ ULONG dy = GetSystemMetrics(SM_CYDRAG);
rect.left = pt.x - dx;
rect.right = pt.x + dx;
for (;;)
{
- while (PeekMessageW(&msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE))
+ while (
+ PeekMessageW(&msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE) ||
+ PeekMessageW(&msg, 0, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)
+ )
{
if (msg.message == WM_LBUTTONUP)
{
ReleaseCapture();
- return 0;
+ return FALSE;
}
if (msg.message == WM_MOUSEMOVE)
{
if (!PtInRect(&rect, tmp))
{
ReleaseCapture();
- return 1;
+ return TRUE;
}
}
+ if (msg.message == WM_KEYDOWN)
+ {
+ if (msg.wParam == VK_ESCAPE)
+ {
+ ReleaseCapture();
+ return TRUE;
+ }
+ }
}
WaitMessage();
}
NTAPI
NtUserDragDetect(
HWND hWnd,
- LONG x,
- LONG y);
+ POINT pt);
DWORD
NTAPI
NTAPI
NtUserGetShellWindow();
-ULONG
-NTAPI
-NtUserGetSystemMetrics(ULONG Index);
-
HWND
NTAPI
NtUserGetWindow(HWND hWnd, UINT Relationship);
STDCALL
NtUserDragDetect(
HWND hWnd,
- LONG x,
- LONG y)
+ POINT pt) // Just like the User call.
{
UNIMPLEMENTED
return 0;
}
}
-ULONG STDCALL
-NtUserGetSystemMetrics(ULONG Index)
-{
- DECLARE_RETURN(ULONG);
-
- DPRINT("Enter NtUserGetSystemMetrics\n");
- UserEnterShared();
-
- RETURN(UserGetSystemMetrics(Index));
-
-CLEANUP:
- DPRINT("Leave NtUserGetSystemMetrics, ret=%i\n",_ret_);
- UserLeave();
- END_CLEANUP;
-}
-
/* EOF */