Create a branch for network fixes.
[reactos.git] / include / ddk / punknown.h
1 /*
2 ReactOS Kernel-Mode COM
3 by Andrew Greenwood
4
5 Please see COPYING in the top-level directory for license information.
6 */
7
8 #ifndef _UNKNOWN_H_
9 #define _UNKNOWN_H_
10
11 #include <windef.h>
12 #define COM_NO_WINDOWS_H
13 #include <basetyps.h>
14
15 #ifdef PUT_GUIDS_HERE
16 #include <initguid.h>
17 #endif
18
19
20 /* ===============================================================
21 IUnknown
22 */
23
24 #ifndef __IUnknown_INTERFACE_DEFINED__
25 #define __IUnknown_INTERFACE_DEFINED__
26 DEFINE_GUID(
27 IID_IUnknown,
28 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x46);
29
30 #undef INTERFACE
31 #define INTERFACE IUnknown
32
33 DECLARE_INTERFACE(IUnknown)
34 {
35 STDMETHOD_(NTSTATUS, QueryInterface)( THIS_
36 IN REFIID,
37 OUT PVOID*)
38 PURE;
39
40 STDMETHOD_(ULONG, AddRef)( THIS )
41 PURE;
42
43 STDMETHOD_(ULONG, Release)( THIS )
44 PURE;
45 };
46 #endif
47
48 #undef INTERFACE
49
50 typedef IUnknown *PUNKNOWN;
51
52
53 /* ===============================================================
54 IUnknown definition
55 Boilerplate code macro for use in subclassed interfaces
56 */
57
58 #define DEFINE_ABSTRACT_UNKNOWN() \
59 STDMETHOD_(NTSTATUS, QueryInterface)( THIS_ \
60 REFIID InterfaceId, \
61 PVOID* Interface) \
62 PURE; \
63 \
64 STDMETHOD_(ULONG, AddRef)(THIS) \
65 PURE; \
66 \
67 STDMETHOD_(ULONG, Release)(THIS) \
68 PURE;
69
70
71 /* ===============================================================
72 Constructor callback definition
73 */
74
75 typedef HRESULT (*PFNCREATEINSTANCE)(
76 OUT PUNKNOWN* Unknown,
77 IN REFCLSID ClassId,
78 IN PUNKNOWN OuterUnknown,
79 IN POOL_TYPE PoolType);
80
81 #endif