Various cosmetic changes.
[wine] / dlls / ole32 / compobj_private.h
1 #ifndef __WINE_OLE_COMPOBJ_H
2 #define __WINE_OLE_COMPOBJ_H
3
4 /* All private prototype functions used by OLE will be added to this header file */
5
6 #include "wtypes.h"
7
8 extern HRESULT WINE_StringFromCLSID(const CLSID *id,LPSTR idstr);
9 extern HRESULT create_marshalled_proxy(REFCLSID rclsid, REFIID iid, LPVOID *ppv);
10
11 inline static HRESULT
12 get_facbuf_for_iid(REFIID riid,IPSFactoryBuffer **facbuf) {
13     HRESULT       hres;
14     CLSID         pxclsid;
15
16     if ((hres = CoGetPSClsid(riid,&pxclsid)))
17         return hres;
18     return CoGetClassObject(&pxclsid,CLSCTX_INPROC_SERVER,NULL,&IID_IPSFactoryBuffer,(LPVOID*)facbuf);
19 }
20
21 #define PIPEPREF "\\\\.\\pipe\\"
22 #define OLESTUBMGR PIPEPREF"WINE_OLE_StubMgr"
23 /* Standard Marshaling definitions */
24 typedef struct _wine_marshal_id {
25     DWORD       processid;
26     DWORD       objectid;       /* unique value corresp. IUnknown of object */
27     IID         iid;
28 } wine_marshal_id;
29
30 inline static BOOL
31 MARSHAL_Compare_Mids(wine_marshal_id *mid1,wine_marshal_id *mid2) {
32     return
33         (mid1->processid == mid2->processid)    &&
34         (mid1->objectid == mid2->objectid)      &&
35         IsEqualIID(&(mid1->iid),&(mid2->iid))
36     ;
37 }
38
39 /* compare without interface compare */
40 inline static BOOL
41 MARSHAL_Compare_Mids_NoInterface(wine_marshal_id *mid1, wine_marshal_id *mid2) {
42     return
43         (mid1->processid == mid2->processid)    &&
44         (mid1->objectid == mid2->objectid)
45     ;
46 }
47
48 HRESULT MARSHAL_Find_Stub_Buffer(wine_marshal_id *mid,IRpcStubBuffer **stub);
49 HRESULT MARSHAL_Find_Stub_Server(wine_marshal_id *mid,LPUNKNOWN *punk);
50 HRESULT MARSHAL_Register_Stub(wine_marshal_id *mid,LPUNKNOWN punk, IRpcStubBuffer *stub);
51
52 HRESULT MARSHAL_GetStandardMarshalCF(LPVOID *ppv);
53
54 typedef struct _wine_marshal_data {
55     DWORD       dwDestContext;
56     DWORD       mshlflags;
57 } wine_marshal_data;
58
59
60 #define REQTYPE_REQUEST         0
61 typedef struct _wine_rpc_request_header {
62     DWORD               reqid;
63     wine_marshal_id     mid;
64     DWORD               iMethod;
65     DWORD               cbBuffer;
66 } wine_rpc_request_header;
67
68 #define REQTYPE_RESPONSE        1
69 typedef struct _wine_rpc_response_header {
70     DWORD               reqid;
71     DWORD               cbBuffer;
72     DWORD               retval;
73 } wine_rpc_response_header;
74
75 #define REQSTATE_START                  0
76 #define REQSTATE_REQ_QUEUED             1
77 #define REQSTATE_REQ_WAITING_FOR_REPLY  2
78 #define REQSTATE_REQ_GOT                3
79 #define REQSTATE_INVOKING               4
80 #define REQSTATE_RESP_QUEUED            5
81 #define REQSTATE_RESP_GOT               6
82 #define REQSTATE_DONE                   6
83
84 void STUBMGR_Start();
85
86 extern HRESULT PIPE_GetNewPipeBuf(wine_marshal_id *mid, IRpcChannelBuffer **pipebuf);
87
88 /* This function initialize the Running Object Table */
89 HRESULT WINAPI RunningObjectTableImpl_Initialize();
90
91 /* This function uninitialize the Running Object Table */
92 HRESULT WINAPI RunningObjectTableImpl_UnInitialize();
93
94 /* This function decomposes a String path to a String Table containing all the elements ("\" or "subDirectory" or "Directory" or "FileName") of the path */
95 int WINAPI FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR** stringTable);
96
97 #endif /* __WINE_OLE_COMPOBJ_H */