1 #ifndef __WINE_HANDLE32_H
2 #define __WINE_HANDLE32_H
7 /* The _*_OBJECT structures contain information needed about each
8 * particular type of handle. This information is a combination of
9 * equivalent UNIX-style handles/descriptors and general information
10 * that the Win32 API might request.
12 * The KERNEL_OBJECT structure must be the first member of any specific
13 * kernel object type's structure.
18 } KERNEL_OBJECT
, *HANDLE32
;
22 unsigned long thread_id
;
23 unsigned long process_id
;
28 unsigned long process_id
;
29 unsigned long main_thread_id
;
32 /* The FILE object includes things like disk files, pipes, and
33 * character devices (com ports, consoles, ...).
38 int type
; /* FILE_TYPE_* */
39 unsigned long misc_flags
; /* special flags */
40 unsigned long access_flags
; /* UNIX access flags */
41 unsigned long create_flags
; /* UNIX creation flags */
46 FILE_OBJECT
*file_obj
;
59 /* Should this even be here?
65 typedef struct _VRANGE_OBJECT
{
69 struct _VRANGE_OBJECT
*next
;
72 struct _HEAPITEM_OBJECT
;
79 struct _HEAPITEM_OBJECT
*first
,*last
;
82 typedef struct _HEAPITEM_OBJECT
{
85 DWORD size
; /* size including header */
86 struct _HEAPITEM_OBJECT
*next
,*prev
;
90 /* Object number definitions. These numbers are used to
91 * validate the kernel object by comparison against the
92 * object's 'magic' value.
94 #define KERNEL_OBJECT_UNUSED 2404554046UL
95 #define KERNEL_OBJECT_THREAD (KERNEL_OBJECT_UNUSED + 1)
96 #define KERNEL_OBJECT_PROCESS (KERNEL_OBJECT_UNUSED + 2)
97 #define KERNEL_OBJECT_FILE (KERNEL_OBJECT_UNUSED + 3)
98 #define KERNEL_OBJECT_SEMAPHORE (KERNEL_OBJECT_UNUSED + 4)
99 #define KERNEL_OBJECT_EVENT (KERNEL_OBJECT_UNUSED + 5)
100 #define KERNEL_OBJECT_REGKEY (KERNEL_OBJECT_UNUSED + 6)
101 #define KERNEL_OBJECT_FILEMAP (KERNEL_OBJECT_UNUSED + 7)
102 #define KERNEL_OBJECT_VRANGE (KERNEL_OBJECT_UNUSED + 8)
103 #define KERNEL_OBJECT_HEAP (KERNEL_OBJECT_UNUSED + 9)
104 #define KERNEL_OBJECT_HEAPITEM (KERNEL_OBJECT_UNUSED + 10)
106 /* Define the invalid handle value
108 #define INVALID_HANDLE_VALUE ((HANDLE32)-1)
110 /* Functions for checking kernel objects.
112 int ValidateKernelObject(KERNEL_OBJECT
*ptr
);
114 /* For now, CreateKernelObject and ReleaseKernelObject will
115 * simply map to malloc() and free().
117 #define CreateKernelObject(size) (malloc(size))
118 #define ReleaseKernelObject(ptr) (free(ptr))
120 /* Prototypes for the Close*Handle functions
122 int CloseFileHandle(FILE_OBJECT
*hFile
);
124 #endif /* __WINE_HANDLE32_H */