reactos/subsys/win32k/include
diff -u -r1.1.4.5 -r1.1.4.6
--- internal.h 31 Aug 2004 14:34:38 -0000 1.1.4.5
+++ internal.h 1 Sep 2004 14:14:26 -0000 1.1.4.6
@@ -695,7 +695,8 @@
ATOM Atom;
} PROPERTY;
-BOOL FASTCALL IntSetProp(PWINDOW_OBJECT Wnd, ATOM Atom, HANDLE Data);
+BOOL FASTCALL IntSetProp(PWINDOW_OBJECT WindowObject, ATOM Atom, HANDLE Data);
+BOOL FASTCALL IntRemoveProp(PWINDOW_OBJECT WindowObject, ATOM Atom, HANDLE *Data);
PPROPERTY FASTCALL IntGetProp(PWINDOW_OBJECT WindowObject, ATOM Atom);
/* SCROLL BARS ****************************************************************/
@@ -925,9 +926,10 @@
WORD FASTCALL IntSetWindowWord(PWINDOW_OBJECT WindowObject, INT Index, WORD NewValue);
ULONG FASTCALL IntGetWindowThreadProcessId(PWINDOW_OBJECT Window, ULONG *Pid);
PWINDOW_OBJECT FASTCALL IntGetWindow(PWINDOW_OBJECT Window, UINT uCmd);
-DWORD IntRemoveWndProcHandle(WNDPROC Handle);
-DWORD IntRemoveProcessWndProcHandles(HANDLE ProcessID);
-DWORD IntAddWndProcHandle(WNDPROC WindowProc, BOOL IsUnicode);
+BOOL FASTCALL IntDereferenceWndProcHandle(WNDPROC wpHandle, WndProcHandle *Data);
+DWORD FASTCALL IntRemoveWndProcHandle(WNDPROC Handle);
+DWORD FASTCALL IntRemoveProcessWndProcHandles(HANDLE ProcessID);
+DWORD FASTCALL IntAddWndProcHandle(WNDPROC WindowProc, BOOL IsUnicode);
/* WINPOS *********************************************************************/
reactos/subsys/win32k/ntuser
diff -u -r1.1.4.6 -r1.1.4.7
--- ntuser.c 31 Aug 2004 14:34:39 -0000 1.1.4.6
+++ ntuser.c 1 Sep 2004 14:14:26 -0000 1.1.4.7
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: ntuser.c,v 1.1.4.6 2004/08/31 14:34:39 weiden Exp $
+/* $Id: ntuser.c,v 1.1.4.7 2004/09/01 14:14:26 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -45,7 +45,7 @@
} \
return Result; \
error: \
- return ErrorResult;
+ return ErrorResult
#define END_NTUSER_NOERR() \
return Result;
@@ -533,6 +533,19 @@
}
BOOL STDCALL
+NtUserDereferenceWndProcHandle(WNDPROC wpHandle, WndProcHandle *Data)
+{
+ BEGIN_NTUSER_NOERR(BOOL);
+
+ ENTER_CRITICAL();
+ /* FIXME - probe the buffer Data points to */
+ Result = IntDereferenceWndProcHandle(wpHandle, Data);
+ LEAVE_CRITICAL();
+
+ END_NTUSER_NOERR();
+}
+
+BOOL STDCALL
NtUserDestroyCursorIcon(HANDLE Handle,
DWORD Unknown)
{
@@ -586,7 +599,7 @@
NTUSER_COPY_BUFFER_NTERROR(&MsgInfo, UnsafeMsgInfo, sizeof(NTUSERDISPATCHMESSAGEINFO));
- ENTER_CRITICAL();
+ ENTER_CRITICAL_SHARED();
if(MsgInfo.Msg.hwnd != NULL)
{
/* win doesn't set a last error in this case */
@@ -645,7 +658,7 @@
back the buffer */
NTUSER_COPY_BUFFER_W32ERROR(&SafePs, lPs, sizeof(PAINTSTRUCT), ERROR_NOACCESS);
- ENTER_CRITICAL();
+ ENTER_CRITICAL_SHARED();
if(hWnd != NULL)
{
VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
@@ -716,7 +729,7 @@
case GA_ROOT:
case GA_ROOTOWNER:
{
- ENTER_CRITICAL();
+ ENTER_CRITICAL_SHARED();
VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
Ancestor = IntGetAncestor(Window, Type);
Result = (Ancestor != NULL ? Ancestor->Handle : NULL);
@@ -864,7 +877,7 @@
NTUSER_FAIL_INVALID_PARAMETER(IconInfo, NULL);
- ENTER_CRITICAL();
+ ENTER_CRITICAL_SHARED();
VALIDATE_USER_OBJECT(CURSOR, Handle, Cursor);
IntGetCursorIconInfo(Cursor, &SafeInfo);
LEAVE_CRITICAL();
@@ -891,7 +904,7 @@
NTUSER_FAIL_INVALID_PARAMETER(fIcon, NULL);
NTUSER_FAIL_INVALID_PARAMETER(Size, NULL);
- ENTER_CRITICAL();
+ ENTER_CRITICAL_SHARED();
VALIDATE_USER_OBJECT(CURSOR, Handle, Cursor);
Result = IntGetCursorIconSize(Cursor, &SafeIsIcon, &SafeSize);
LEAVE_CRITICAL();
@@ -1031,7 +1044,7 @@
GotMessage = FALSE;
- ENTER_CRITICAL();
+ ENTER_CRITICAL_SHARED();
if(Wnd != NULL)
{
VALIDATE_USER_OBJECT(WINDOW, Wnd, Window);
@@ -1121,6 +1134,22 @@
END_NTUSER();
}
+HANDLE STDCALL
+NtUserGetProp(HWND hWnd, ATOM Atom)
+{
+ PPROPERTY Property;
+ NTUSER_USER_OBJECT(WINDOW, Window);
+ BEGIN_NTUSER(HANDLE, NULL);
+
+ ENTER_CRITICAL_SHARED();
+ VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
+ Property = IntGetProp(Window, Atom);
+ Result = (Property != NULL ? Property->Data : NULL);
+ LEAVE_CRITICAL();
+
+ END_NTUSER();
+}
+
HWND STDCALL
NtUserGetShellWindow()
{
@@ -1146,7 +1175,7 @@
NTUSER_FAIL();
}
- ENTER_CRITICAL();
+ ENTER_CRITICAL_SHARED();
Result = IntGetSystemMetrics(Index);
LEAVE_CRITICAL();
@@ -1162,7 +1191,7 @@
BEGIN_NTUSER(BOOL, FALSE);
/* FIXME - if bErase == FALSE, should we do ENTER_CRITICAL_SHARED() instead? */
- ENTER_CRITICAL();
+ ENTER_CRITICAL_SHARED();
VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
Result = IntGetUpdateRect(Window, &SafeRect, bErase);
LEAVE_CRITICAL();
@@ -1182,7 +1211,7 @@
BEGIN_NTUSER(INT, ERROR);
/* FIXME - if bErase == FALSE, should we do ENTER_CRITICAL_SHARED() instead? */
- ENTER_CRITICAL();
+ ENTER_CRITICAL_SHARED();
VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
Result = IntGetUpdateRgn(Window, hRgn, bErase);
LEAVE_CRITICAL();
@@ -1212,7 +1241,7 @@
NTUSER_USER_OBJECT(WINDOW, Window);
BEGIN_NTUSER(HDC, NULL);
- ENTER_CRITICAL();
+ ENTER_CRITICAL_SHARED();
if(hWnd != NULL)
{
VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
@@ -1357,7 +1386,7 @@
MsgFilterMax = 0;
}
- ENTER_CRITICAL();
+ ENTER_CRITICAL_SHARED();
if(hWnd != NULL)
{
VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
@@ -1513,6 +1542,35 @@
END_NTUSER();
}
+BOOL STDCALL
+NtUserRedrawWindow(HWND hWnd, CONST RECT *lprcUpdate, HRGN hrgnUpdate,
+ UINT flags)
+{
+ NTUSER_USER_OBJECT(WINDOW, Window);
+ BEGIN_NTUSER(BOOL, FALSE);
+
+ /* FIXME - probe lprcUpdate! */
+
+ ENTER_CRITICAL_SHARED();
+ if(hWnd != NULL)
+ {
+ VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
+ }
+ else
+ {
+ if(!(Window = IntGetDesktopWindow()))
+ {
+ LEAVE_CRITICAL();
+ DPRINT1("RedrawWindow(): Unable to get desktop window!\n");
+ NTUSER_FAIL_ERROR(ERROR_ACCESS_DENIED);
+ }
+ }
+ Result = IntRedrawWindow(Window, (LPRECT)lprcUpdate, hrgnUpdate, flags);
+ LEAVE_CRITICAL();
+
+ END_NTUSER();
+}
+
RTL_ATOM STDCALL
NtUserRegisterClassExWOW(CONST WNDCLASSEXW* lpwcx,
PUNICODE_STRING ClassName,
@@ -1594,7 +1652,7 @@
NTUSER_USER_OBJECT(WINDOW, Window);
BEGIN_NTUSER(INT, 0);
- ENTER_CRITICAL();
+ ENTER_CRITICAL_SHARED();
if(hWnd != NULL)
{
VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
@@ -1616,6 +1674,23 @@
END_NTUSER();
}
+HANDLE STDCALL
+NtUserRemoveProp(HWND hWnd, ATOM Atom)
+{
+ NTUSER_USER_OBJECT(WINDOW, Window);
+ BEGIN_NTUSER(HANDLE, NULL);
+
+ ENTER_CRITICAL();
+ VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
+ if(!IntRemoveProp(Window, Atom, &Result))
+ {
+ Result = NULL;
+ }
+ LEAVE_CRITICAL();
+
+ END_NTUSER();
+}
+
UINT STDCALL
NtUserSendInput(UINT nInputs,
LPINPUT pInput,
@@ -1879,6 +1954,20 @@
}
BOOL STDCALL
+NtUserSetProp(HWND hWnd, ATOM Atom, HANDLE Data)
+{
+ NTUSER_USER_OBJECT(WINDOW, Window);
+ BEGIN_NTUSER(BOOL, FALSE);
+
+ ENTER_CRITICAL();
+ VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
+ Result = IntSetProp(Window, Atom, Data);
+ LEAVE_CRITICAL();
+
+ END_NTUSER();
+}
+
+BOOL STDCALL
NtUserSetShellWindowEx(HWND hwndShell, HWND hwndListView)
{
NTUSER_USER_OBJECT(WINDOW, ShellWindow);
reactos/subsys/win32k/ntuser
diff -u -r1.11.12.1 -r1.11.12.2
--- prop.c 15 Jul 2004 20:07:18 -0000 1.11.12.1
+++ prop.c 1 Sep 2004 14:14:26 -0000 1.11.12.2
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: prop.c,v 1.11.12.1 2004/07/15 20:07:18 weiden Exp $
+/* $Id: prop.c,v 1.11.12.2 2004/09/01 14:14:26 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -30,7 +30,7 @@
#include <w32k.h>
-//#define NDEBUG
+#define NDEBUG
#include <debug.h>
typedef struct _PROPLISTITEM
@@ -48,39 +48,63 @@
PPROPERTY Property;
ListEntry = WindowObject->PropListHead.Flink;
- while (ListEntry != &WindowObject->PropListHead)
+ while(ListEntry != &WindowObject->PropListHead)
+ {
+ Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
+ if(Property->Atom == Atom)
{
- Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
- if (Property->Atom == Atom)
- {
- return(Property);
- }
- ListEntry = ListEntry->Flink;
+ return Property;
}
- return(NULL);
+ ListEntry = ListEntry->Flink;
+ }
+
+ return NULL;
}
BOOL FASTCALL
-IntSetProp(PWINDOW_OBJECT Wnd, ATOM Atom, HANDLE Data)
+IntRemoveProp(PWINDOW_OBJECT WindowObject, ATOM Atom, HANDLE *Data)
{
- PPROPERTY Prop;
+ PLIST_ENTRY ListEntry;
+ PPROPERTY Property;
+
+ ASSERT(Data);
- Prop = IntGetProp(Wnd, Atom);
+ ListEntry = WindowObject->PropListHead.Flink;
+ while(ListEntry != &WindowObject->PropListHead)
+ {
+ Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
+ if(Property->Atom == Atom)
+ {
+ *Data = Property->Data;
+ RemoveEntryList(&Property->PropListEntry);
+ ExFreePool(Property);
+ return TRUE;
+ }
+ ListEntry = ListEntry->Flink;
+ }
+
+ return FALSE;
+}
- if (Prop == NULL)
+BOOL FASTCALL
+IntSetProp(PWINDOW_OBJECT WindowObject, ATOM Atom, HANDLE Data)
+{
+ PPROPERTY Prop = IntGetProp(WindowObject, Atom);
+ if(Prop == NULL)
{
Prop = ExAllocatePoolWithTag(PagedPool, sizeof(PROPERTY), TAG_WNDPROP);
- if (Prop == NULL)
+ if(Prop != NULL)
{
- return FALSE;
+ Prop->Atom = Atom;
+ Prop->Data = Data;
+ InsertTailList(&WindowObject->PropListHead, &Prop->PropListEntry);
+ WindowObject->PropListItems++;
+
+ return TRUE;
}
- Prop->Atom = Atom;
- InsertTailList(&Wnd->PropListHead, &Prop->PropListEntry);
- Wnd->PropListItems++;
}
- Prop->Data = Data;
- return TRUE;
+ return FALSE;
}
/* EOF */