New examples/documentation for console configuration options.
[wine] / include / k32obj.h
1 /*
2  * KERNEL32 objects
3  *
4  * Copyright 1996, 1998 Alexandre Julliard
5  */
6
7 #ifndef __WINE_K32OBJ_H
8 #define __WINE_K32OBJ_H
9
10 #include "wintypes.h"
11 #include "windows.h"
12
13 /* Object types */
14 typedef enum
15 {
16     K32OBJ_UNKNOWN = 0,
17     K32OBJ_SEMAPHORE,
18     K32OBJ_EVENT,
19     K32OBJ_MUTEX,
20     K32OBJ_CRITICAL_SECTION,
21     K32OBJ_PROCESS,
22     K32OBJ_THREAD,
23     K32OBJ_FILE,
24     K32OBJ_CHANGE,
25     K32OBJ_CONSOLE,
26     K32OBJ_SCREEN_BUFFER,
27     K32OBJ_MEM_MAPPED_FILE,
28     K32OBJ_SERIAL,
29     K32OBJ_DEVICE_IOCTL,
30     K32OBJ_PIPE,
31     K32OBJ_MAILSLOT,
32     K32OBJ_TOOLHELP_SNAPSHOT,
33     K32OBJ_SOCKET,
34     K32OBJ_NBOBJECTS
35 } K32OBJ_TYPE;
36
37 /* Kernel object */
38 typedef struct
39 {
40     K32OBJ_TYPE   type;
41     LONG          refcount;
42 } K32OBJ;
43
44 /* Kernel object operations */
45 typedef struct
46 {
47     void   (*destroy)(K32OBJ *);          /* Destroy object on refcount==0 */
48 } K32OBJ_OPS;
49
50 extern const K32OBJ_OPS * const K32OBJ_Ops[K32OBJ_NBOBJECTS];
51
52 #define K32OBJ_OPS(obj) (K32OBJ_Ops[(obj)->type])
53
54 extern void K32OBJ_IncCount( K32OBJ *ptr );
55 extern void K32OBJ_DecCount( K32OBJ *ptr );
56 extern BOOL32 K32OBJ_IsValid( K32OBJ *ptr, K32OBJ_TYPE type );
57 extern BOOL32 K32OBJ_AddName( K32OBJ *obj, LPCSTR name );
58 extern K32OBJ *K32OBJ_Create( K32OBJ_TYPE type, DWORD size, LPCSTR name,
59                               int server_handle, DWORD access,
60                               SECURITY_ATTRIBUTES *sa, HANDLE32 *handle );
61 extern K32OBJ *K32OBJ_FindName( LPCSTR name );
62 extern K32OBJ *K32OBJ_FindNameType( LPCSTR name, K32OBJ_TYPE type );
63
64 #endif /* __WINE_K32OBJ_H */