Author: gadamopoulos
Date: Sat Aug 27 18:26:37 2011
New Revision: 53474
URL:
http://svn.reactos.org/svn/reactos?rev=53474&view=rev
Log:
[win32k]
- Move some definitions to a better place
Modified:
trunk/reactos/subsystems/win32/win32k/include/driverobj.h
trunk/reactos/subsystems/win32/win32k/include/misc.h
trunk/reactos/subsystems/win32/win32k/include/ntuser.h
trunk/reactos/subsystems/win32/win32k/pch.h
Modified: trunk/reactos/subsystems/win32/win32k/include/driverobj.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/driverobj.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/driverobj.h [iso-8859-1] Sat Aug 27
18:26:37 2011
@@ -7,6 +7,8 @@
DRIVEROBJ drvobj;
PVOID reserved;
} EDRIVEROBJ, *PEDRIVEROBJ;
+
+typedef DRIVEROBJ *PDRIVEROBJ;
/* Cleanup function */
BOOL NTAPI DRIVEROBJ_Cleanup(PVOID pObject);
Modified: trunk/reactos/subsystems/win32/win32k/include/misc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/misc.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/misc.h [iso-8859-1] Sat Aug 27 18:26:37
2011
@@ -145,3 +145,21 @@
IntSafeCopyUnicodeStringTerminateNULL(PUNICODE_STRING Dest,
PUNICODE_STRING Source);
+
+#define ROUND_DOWN(n, align) \
+ (((ULONG)n) & ~((align) - 1l))
+
+#define ROUND_UP(n, align) \
+ ROUND_DOWN(((ULONG)n) + (align) - 1, (align))
+
+#define LIST_FOR_EACH(elem, list, type, field) \
+ for ((elem) = CONTAINING_RECORD((list)->Flink, type, field); \
+ &(elem)->field != (list) && ((&((elem)->field)) != NULL);
\
+ (elem) = CONTAINING_RECORD((elem)->field.Flink, type, field))
+
+#define LIST_FOR_EACH_SAFE(cursor, cursor2, list, type, field) \
+ for ((cursor) = CONTAINING_RECORD((list)->Flink, type, field), \
+ (cursor2) = CONTAINING_RECORD((cursor)->field.Flink, type, field); \
+ &(cursor)->field != (list) && ((&((cursor)->field)) !=
NULL); \
+ (cursor) = (cursor2), \
+ (cursor2) = CONTAINING_RECORD((cursor)->field.Flink, type, field))
Modified: trunk/reactos/subsystems/win32/win32k/include/ntuser.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/ntuser.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/ntuser.h [iso-8859-1] Sat Aug 27
18:26:37 2011
@@ -20,4 +20,78 @@
BOOL FASTCALL UserIsEntered(VOID);
BOOL FASTCALL UserIsEnteredExclusive(VOID);
+/* User heap */
+extern HANDLE GlobalUserHeap;
+
+PWIN32HEAP
+UserCreateHeap(OUT PSECTION_OBJECT *SectionObject,
+ IN OUT PVOID *SystemBase,
+ IN SIZE_T HeapSize);
+
+static __inline PVOID
+UserHeapAlloc(SIZE_T Bytes)
+{
+ return RtlAllocateHeap(GlobalUserHeap,
+ HEAP_NO_SERIALIZE,
+ Bytes);
+}
+
+static __inline BOOL
+UserHeapFree(PVOID lpMem)
+{
+ return RtlFreeHeap(GlobalUserHeap,
+ HEAP_NO_SERIALIZE,
+ lpMem);
+}
+
+static __inline PVOID
+UserHeapReAlloc(PVOID lpMem,
+ SIZE_T Bytes)
+{
+#if 0
+ /* NOTE: ntoskrnl doesn't export RtlReAllocateHeap... */
+ return RtlReAllocateHeap(GlobalUserHeap,
+ HEAP_NO_SERIALIZE,
+ lpMem,
+ Bytes);
+#else
+ SIZE_T PrevSize;
+ PVOID pNew;
+
+ PrevSize = RtlSizeHeap(GlobalUserHeap,
+ HEAP_NO_SERIALIZE,
+ lpMem);
+
+ if (PrevSize == Bytes)
+ return lpMem;
+
+ pNew = RtlAllocateHeap(GlobalUserHeap,
+ HEAP_NO_SERIALIZE,
+ Bytes);
+ if (pNew != NULL)
+ {
+ if (PrevSize < Bytes)
+ Bytes = PrevSize;
+
+ RtlCopyMemory(pNew,
+ lpMem,
+ Bytes);
+
+ RtlFreeHeap(GlobalUserHeap,
+ HEAP_NO_SERIALIZE,
+ lpMem);
+ }
+
+ return pNew;
+#endif
+}
+
+static __inline PVOID
+UserHeapAddressToUser(PVOID lpMem)
+{
+ PPROCESSINFO W32Process = PsGetCurrentProcessWin32Process();
+ return (PVOID)(((ULONG_PTR)lpMem - (ULONG_PTR)GlobalUserHeap) +
+ (ULONG_PTR)W32Process->HeapMappings.UserMapping);
+}
+
/* EOF */
Modified: trunk/reactos/subsystems/win32/win32k/pch.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/pc…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/pch.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/pch.h [iso-8859-1] Sat Aug 27 18:26:37 2011
@@ -84,99 +84,4 @@
/* Internal Win32K Header */
#include "include/win32kp.h"
-/* Undocumented stuff */
-typedef DRIVEROBJ *PDRIVEROBJ;
-
-/* User heap */
-extern HANDLE GlobalUserHeap;
-
-PWIN32HEAP
-UserCreateHeap(OUT PSECTION_OBJECT *SectionObject,
- IN OUT PVOID *SystemBase,
- IN SIZE_T HeapSize);
-
-static __inline PVOID
-UserHeapAlloc(SIZE_T Bytes)
-{
- return RtlAllocateHeap(GlobalUserHeap,
- HEAP_NO_SERIALIZE,
- Bytes);
-}
-
-static __inline BOOL
-UserHeapFree(PVOID lpMem)
-{
- return RtlFreeHeap(GlobalUserHeap,
- HEAP_NO_SERIALIZE,
- lpMem);
-}
-
-static __inline PVOID
-UserHeapReAlloc(PVOID lpMem,
- SIZE_T Bytes)
-{
-#if 0
- /* NOTE: ntoskrnl doesn't export RtlReAllocateHeap... */
- return RtlReAllocateHeap(GlobalUserHeap,
- HEAP_NO_SERIALIZE,
- lpMem,
- Bytes);
-#else
- SIZE_T PrevSize;
- PVOID pNew;
-
- PrevSize = RtlSizeHeap(GlobalUserHeap,
- HEAP_NO_SERIALIZE,
- lpMem);
-
- if (PrevSize == Bytes)
- return lpMem;
-
- pNew = RtlAllocateHeap(GlobalUserHeap,
- HEAP_NO_SERIALIZE,
- Bytes);
- if (pNew != NULL)
- {
- if (PrevSize < Bytes)
- Bytes = PrevSize;
-
- RtlCopyMemory(pNew,
- lpMem,
- Bytes);
-
- RtlFreeHeap(GlobalUserHeap,
- HEAP_NO_SERIALIZE,
- lpMem);
- }
-
- return pNew;
-#endif
-}
-
-static __inline PVOID
-UserHeapAddressToUser(PVOID lpMem)
-{
- PPROCESSINFO W32Process = PsGetCurrentProcessWin32Process();
- return (PVOID)(((ULONG_PTR)lpMem - (ULONG_PTR)GlobalUserHeap) +
- (ULONG_PTR)W32Process->HeapMappings.UserMapping);
-}
-
-#define ROUND_DOWN(n, align) \
- (((ULONG)n) & ~((align) - 1l))
-
-#define ROUND_UP(n, align) \
- ROUND_DOWN(((ULONG)n) + (align) - 1, (align))
-
-#define LIST_FOR_EACH(elem, list, type, field) \
- for ((elem) = CONTAINING_RECORD((list)->Flink, type, field); \
- &(elem)->field != (list) && ((&((elem)->field)) != NULL);
\
- (elem) = CONTAINING_RECORD((elem)->field.Flink, type, field))
-
-#define LIST_FOR_EACH_SAFE(cursor, cursor2, list, type, field) \
- for ((cursor) = CONTAINING_RECORD((list)->Flink, type, field), \
- (cursor2) = CONTAINING_RECORD((cursor)->field.Flink, type, field); \
- &(cursor)->field != (list) && ((&((cursor)->field)) !=
NULL); \
- (cursor) = (cursor2), \
- (cursor2) = CONTAINING_RECORD((cursor)->field.Flink, type, field))
-
#endif /* __W32K_H */