File: k32obj.h

package info (click to toggle)
wine 0.0.980315-1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 10,136 kB
  • ctags: 26,112
  • sloc: ansic: 156,310; makefile: 1,160; yacc: 807; perl: 655; lex: 555; sh: 304
file content (69 lines) | stat: -rw-r--r-- 1,899 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
 * KERNEL32 objects
 *
 * Copyright 1996, 1998 Alexandre Julliard
 */

#ifndef __WINE_K32OBJ_H
#define __WINE_K32OBJ_H

#include "wintypes.h"
#include "windows.h"

/* Object types */
typedef enum
{
    K32OBJ_UNKNOWN = 0,
    K32OBJ_SEMAPHORE,
    K32OBJ_EVENT,
    K32OBJ_MUTEX,
    K32OBJ_CRITICAL_SECTION,
    K32OBJ_PROCESS,
    K32OBJ_THREAD,
    K32OBJ_FILE,
    K32OBJ_CHANGE,
    K32OBJ_CONSOLE,
    K32OBJ_SCREEN_BUFFER,
    K32OBJ_MEM_MAPPED_FILE,
    K32OBJ_SERIAL,
    K32OBJ_DEVICE_IOCTL,
    K32OBJ_PIPE,
    K32OBJ_MAILSLOT,
    K32OBJ_TOOLHELP_SNAPSHOT,
    K32OBJ_SOCKET,
    K32OBJ_NBOBJECTS
} K32OBJ_TYPE;

/* Kernel object */
typedef struct
{
    K32OBJ_TYPE   type;
    LONG          refcount;
} K32OBJ;

/* Kernel object operations */
typedef struct
{
    BOOL32 (*signaled)(K32OBJ*,DWORD);    /* Is object signaled? */
    BOOL32 (*satisfied)(K32OBJ*,DWORD);   /* Wait on object is satisfied */
    void   (*add_wait)(K32OBJ*,DWORD);    /* Add thread to wait queue */
    void   (*remove_wait)(K32OBJ*,DWORD); /* Remove thread from wait queue */
    BOOL32 (*read)(K32OBJ*,LPVOID,DWORD,LPDWORD,LPOVERLAPPED);
    BOOL32 (*write)(K32OBJ*,LPCVOID,DWORD,LPDWORD,LPOVERLAPPED);
    void   (*destroy)(K32OBJ *);          /* Destroy object on refcount==0 */
} K32OBJ_OPS;

extern const K32OBJ_OPS * const K32OBJ_Ops[K32OBJ_NBOBJECTS];

#define K32OBJ_OPS(obj) (K32OBJ_Ops[(obj)->type])

extern void K32OBJ_IncCount( K32OBJ *ptr );
extern void K32OBJ_DecCount( K32OBJ *ptr );
extern BOOL32 K32OBJ_IsValid( K32OBJ *ptr, K32OBJ_TYPE type );
extern BOOL32 K32OBJ_AddName( K32OBJ *obj, LPCSTR name );
extern K32OBJ *K32OBJ_Create( K32OBJ_TYPE type, DWORD size, LPCSTR name,
                              DWORD access, HANDLE32 *handle );
extern K32OBJ *K32OBJ_FindName( LPCSTR name );
extern K32OBJ *K32OBJ_FindNameType( LPCSTR name, K32OBJ_TYPE type );

#endif /* __WINE_K32OBJ_H */