Author: jimtabor
Date: Tue Jul 8 23:30:10 2008
New Revision: 34379
URL:
http://svn.reactos.org/svn/reactos?rev=34379&view=rev
Log:
- Removed NtUserGetWindowThreadProcessId, updated all related. Wanting to remove this
since I first joined.
- Tested with all my test apps.
Modified:
trunk/reactos/dll/win32/user32/windows/window.c
trunk/reactos/include/reactos/win32k/ntuser.h
trunk/reactos/subsystems/win32/win32k/ntuser/window.c
trunk/reactos/subsystems/win32/win32k/w32ksvc.db
Modified: trunk/reactos/dll/win32/user32/windows/window.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/w…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] Tue Jul 8 23:30:10 2008
@@ -1294,7 +1294,30 @@
GetWindowThreadProcessId(HWND hWnd,
LPDWORD lpdwProcessId)
{
- return NtUserGetWindowThreadProcessId(hWnd, lpdwProcessId);
+ DWORD Ret = 0;
+ PW32THREADINFO ti;
+ PWINDOW pWnd = ValidateHwnd(hWnd);
+
+ if (!pWnd) return Ret;
+
+ ti = pWnd->ti;
+
+ if ( ti )
+ {
+ if ( ti == GetW32ThreadInfo() )
+ { // We are current.
+ if ( lpdwProcessId )
+ *lpdwProcessId = (DWORD)NtCurrentTeb()->Cid.UniqueProcess;
+ Ret = (DWORD)NtCurrentTeb()->Cid.UniqueThread;
+ }
+ else
+ { // Ask kernel for info.
+ if ( lpdwProcessId )
+ *lpdwProcessId = NtUserQueryWindow(hWnd, QUERY_WINDOW_UNIQUE_PROCESS_ID);
+ Ret = NtUserQueryWindow(hWnd, QUERY_WINDOW_UNIQUE_THREAD_ID);
+ }
+ }
+ return Ret;
}
@@ -1604,7 +1627,7 @@
LPCSTR lpString)
{
DWORD ProcessId;
- if(!NtUserGetWindowThreadProcessId(hWnd, &ProcessId))
+ if(!GetWindowThreadProcessId(hWnd, &ProcessId))
{
return FALSE;
}
@@ -1644,7 +1667,7 @@
LPCWSTR lpString)
{
DWORD ProcessId;
- if(!NtUserGetWindowThreadProcessId(hWnd, &ProcessId))
+ if(!GetWindowThreadProcessId(hWnd, &ProcessId))
{
return FALSE;
}
Modified: trunk/reactos/include/reactos/win32k/ntuser.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntu…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] Tue Jul 8 23:30:10 2008
@@ -2725,11 +2725,6 @@
NTAPI
NtUserGetWindowLong(HWND hWnd, DWORD Index, BOOL Ansi);
-DWORD
-NTAPI
-NtUserGetWindowThreadProcessId(HWND hWnd, LPDWORD UnsafePid);
-
-
/* (other FocusedItem values give the position of the focused item) */
#define NO_SELECTED_ITEM 0xffff
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Tue Jul 8 23:30:10
2008
@@ -3883,39 +3883,6 @@
CLEANUP:
DPRINT("Leave NtUserGetWindowPlacement, ret=%i\n",_ret_);
- UserLeave();
- END_CLEANUP;
-}
-
-
-/*
- * @implemented
- */
-DWORD STDCALL
-NtUserGetWindowThreadProcessId(HWND hWnd, LPDWORD UnsafePid)
-{
- PWINDOW_OBJECT Wnd;
- DWORD tid, pid;
- DECLARE_RETURN(DWORD);
-
- DPRINT("Enter NtUserGetWindowThreadProcessId\n");
- UserEnterShared();
-
- if (!(Wnd = UserGetWindowObject(hWnd)))
- {
- RETURN( 0);
- }
-
- tid = (DWORD)IntGetWndThreadId(Wnd);
- pid = (DWORD)IntGetWndProcessId(Wnd);
-
- if (UnsafePid)
- MmCopyToCaller(UnsafePid, &pid, sizeof(DWORD));
-
- RETURN( tid);
-
-CLEANUP:
- DPRINT("Leave NtUserGetWindowThreadProcessId, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
Modified: trunk/reactos/subsystems/win32/win32k/w32ksvc.db
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/w3…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/w32ksvc.db [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/w32ksvc.db [iso-8859-1] Tue Jul 8 23:30:10
2008
@@ -690,7 +690,6 @@
NtUserGetShellWindow 0
NtUserGetWindow 2
NtUserGetWindowLong 3
-NtUserGetWindowThreadProcessId 2
NtUserMenuInfo 3
NtUserMenuItemInfo 5
NtUserMonitorFromPoint 3