Release 980104
[wine/multimedia.git] / include / k32obj.h
blobafe3c94c1a68fd25c83f1f392360e4850fcbab7f
1 /*
2 * KERNEL32 objects
4 * Copyright 1996, 1998 Alexandre Julliard
5 */
7 #ifndef __WINE_K32OBJ_H
8 #define __WINE_K32OBJ_H
10 #include "wintypes.h"
12 /* Object types */
13 typedef enum
15 K32OBJ_UNKNOWN = 0,
16 K32OBJ_SEMAPHORE,
17 K32OBJ_EVENT,
18 K32OBJ_MUTEX,
19 K32OBJ_CRITICAL_SECTION,
20 K32OBJ_PROCESS,
21 K32OBJ_THREAD,
22 K32OBJ_FILE,
23 K32OBJ_CHANGE,
24 K32OBJ_CONSOLE,
25 K32OBJ_SCREEN_BUFFER,
26 K32OBJ_MEM_MAPPED_FILE,
27 K32OBJ_SERIAL,
28 K32OBJ_DEVICE_IOCTL,
29 K32OBJ_PIPE,
30 K32OBJ_MAILSLOT,
31 K32OBJ_TOOLHELP_SNAPSHOT,
32 K32OBJ_SOCKET,
33 K32OBJ_NBOBJECTS
34 } K32OBJ_TYPE;
36 /* Kernel object */
37 typedef struct
39 K32OBJ_TYPE type;
40 LONG refcount;
41 } K32OBJ;
43 /* Kernel object operations */
44 typedef struct
46 BOOL32 (*signaled)(K32OBJ*,DWORD); /* Is object signaled? */
47 void (*satisfied)(K32OBJ*,DWORD); /* Wait on object is satisfied */
48 void (*add_wait)(K32OBJ*,DWORD); /* Add thread to wait queue */
49 void (*remove_wait)(K32OBJ*,DWORD); /* Remove thread from wait queue */
50 void (*destroy)(K32OBJ *); /* Destroy object on refcount==0 */
51 } K32OBJ_OPS;
53 extern const K32OBJ_OPS * const K32OBJ_Ops[K32OBJ_NBOBJECTS];
55 #define K32OBJ_OPS(obj) (K32OBJ_Ops[(obj)->type])
57 extern void K32OBJ_IncCount( K32OBJ *ptr );
58 extern void K32OBJ_DecCount( K32OBJ *ptr );
59 extern BOOL32 K32OBJ_IsValid( K32OBJ *ptr, K32OBJ_TYPE type );
60 extern BOOL32 K32OBJ_AddName( K32OBJ *obj, LPCSTR name );
61 extern K32OBJ *K32OBJ_Create( K32OBJ_TYPE type, DWORD size, LPCSTR name,
62 HANDLE32 *handle );
63 extern K32OBJ *K32OBJ_FindName( LPCSTR name );
64 extern K32OBJ *K32OBJ_FindNameType( LPCSTR name, K32OBJ_TYPE type );
66 #endif /* __WINE_K32OBJ_H */