| 1 | /* | 
|---|
| 2 | * Copyright 1995 Martin von Loewis | 
|---|
| 3 | * Copyright 1998 Justin Bradford | 
|---|
| 4 | * Copyright 1999 Francis Beaudet | 
|---|
| 5 | * Copyright 1999 Sylvain St-Germain | 
|---|
| 6 | * Copyright 2002 Marcus Meissner | 
|---|
| 7 | * | 
|---|
| 8 | * This library is free software; you can redistribute it and/or | 
|---|
| 9 | * modify it under the terms of the GNU Lesser General Public | 
|---|
| 10 | * License as published by the Free Software Foundation; either | 
|---|
| 11 | * version 2.1 of the License, or (at your option) any later version. | 
|---|
| 12 | * | 
|---|
| 13 | * This library is distributed in the hope that it will be useful, | 
|---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | 
|---|
| 16 | * Lesser General Public License for more details. | 
|---|
| 17 | * | 
|---|
| 18 | * You should have received a copy of the GNU Lesser General Public | 
|---|
| 19 | * License along with this library; if not, write to the Free Software | 
|---|
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA | 
|---|
| 21 | */ | 
|---|
| 22 | #ifndef __WINE_OLE_COMPOBJ_H | 
|---|
| 23 | #define __WINE_OLE_COMPOBJ_H | 
|---|
| 24 |  | 
|---|
| 25 | #ifdef __WIN32OS2__ | 
|---|
| 26 | #undef inline | 
|---|
| 27 | #define inline | 
|---|
| 28 |  | 
|---|
| 29 | #include "wine/obj_moniker.h" | 
|---|
| 30 |  | 
|---|
| 31 | #endif | 
|---|
| 32 |  | 
|---|
| 33 | /* All private prototype functions used by OLE will be added to this header file */ | 
|---|
| 34 |  | 
|---|
| 35 | #include "wtypes.h" | 
|---|
| 36 |  | 
|---|
| 37 | extern HRESULT WINE_StringFromCLSID(const CLSID *id,LPSTR idstr); | 
|---|
| 38 | extern HRESULT create_marshalled_proxy(REFCLSID rclsid, REFIID iid, LPVOID *ppv); | 
|---|
| 39 |  | 
|---|
| 40 | inline static HRESULT | 
|---|
| 41 | get_facbuf_for_iid(REFIID riid,IPSFactoryBuffer **facbuf) { | 
|---|
| 42 | HRESULT       hres; | 
|---|
| 43 | CLSID         pxclsid; | 
|---|
| 44 |  | 
|---|
| 45 | if ((hres = CoGetPSClsid(riid,&pxclsid))) | 
|---|
| 46 | return hres; | 
|---|
| 47 | return CoGetClassObject(&pxclsid,CLSCTX_INPROC_SERVER,NULL,&IID_IPSFactoryBuffer,(LPVOID*)facbuf); | 
|---|
| 48 | } | 
|---|
| 49 |  | 
|---|
| 50 | #define PIPEPREF "\\\\.\\pipe\\" | 
|---|
| 51 | #define OLESTUBMGR PIPEPREF"WINE_OLE_StubMgr" | 
|---|
| 52 | /* Standard Marshaling definitions */ | 
|---|
| 53 | typedef struct _wine_marshal_id { | 
|---|
| 54 | DWORD       processid; | 
|---|
| 55 | DWORD       objectid;       /* unique value corresp. IUnknown of object */ | 
|---|
| 56 | IID         iid; | 
|---|
| 57 | } wine_marshal_id; | 
|---|
| 58 |  | 
|---|
| 59 | inline static BOOL | 
|---|
| 60 | MARSHAL_Compare_Mids(wine_marshal_id *mid1,wine_marshal_id *mid2) { | 
|---|
| 61 | return | 
|---|
| 62 | (mid1->processid == mid2->processid)    && | 
|---|
| 63 | (mid1->objectid == mid2->objectid)      && | 
|---|
| 64 | IsEqualIID(&(mid1->iid),&(mid2->iid)) | 
|---|
| 65 | ; | 
|---|
| 66 | } | 
|---|
| 67 |  | 
|---|
| 68 | /* compare without interface compare */ | 
|---|
| 69 | inline static BOOL | 
|---|
| 70 | MARSHAL_Compare_Mids_NoInterface(wine_marshal_id *mid1, wine_marshal_id *mid2) { | 
|---|
| 71 | return | 
|---|
| 72 | (mid1->processid == mid2->processid)    && | 
|---|
| 73 | (mid1->objectid == mid2->objectid) | 
|---|
| 74 | ; | 
|---|
| 75 | } | 
|---|
| 76 |  | 
|---|
| 77 | HRESULT MARSHAL_Find_Stub_Buffer(wine_marshal_id *mid,IRpcStubBuffer **stub); | 
|---|
| 78 | HRESULT MARSHAL_Find_Stub_Server(wine_marshal_id *mid,LPUNKNOWN *punk); | 
|---|
| 79 | HRESULT MARSHAL_Register_Stub(wine_marshal_id *mid,LPUNKNOWN punk, IRpcStubBuffer *stub); | 
|---|
| 80 |  | 
|---|
| 81 | HRESULT MARSHAL_GetStandardMarshalCF(LPVOID *ppv); | 
|---|
| 82 |  | 
|---|
| 83 | typedef struct _wine_marshal_data { | 
|---|
| 84 | DWORD       dwDestContext; | 
|---|
| 85 | DWORD       mshlflags; | 
|---|
| 86 | } wine_marshal_data; | 
|---|
| 87 |  | 
|---|
| 88 |  | 
|---|
| 89 | #define REQTYPE_REQUEST         0 | 
|---|
| 90 | typedef struct _wine_rpc_request_header { | 
|---|
| 91 | DWORD               reqid; | 
|---|
| 92 | wine_marshal_id     mid; | 
|---|
| 93 | DWORD               iMethod; | 
|---|
| 94 | DWORD               cbBuffer; | 
|---|
| 95 | } wine_rpc_request_header; | 
|---|
| 96 |  | 
|---|
| 97 | #define REQTYPE_RESPONSE        1 | 
|---|
| 98 | typedef struct _wine_rpc_response_header { | 
|---|
| 99 | DWORD               reqid; | 
|---|
| 100 | DWORD               cbBuffer; | 
|---|
| 101 | DWORD               retval; | 
|---|
| 102 | } wine_rpc_response_header; | 
|---|
| 103 |  | 
|---|
| 104 | #define REQSTATE_START                  0 | 
|---|
| 105 | #define REQSTATE_REQ_QUEUED             1 | 
|---|
| 106 | #define REQSTATE_REQ_WAITING_FOR_REPLY  2 | 
|---|
| 107 | #define REQSTATE_REQ_GOT                3 | 
|---|
| 108 | #define REQSTATE_INVOKING               4 | 
|---|
| 109 | #define REQSTATE_RESP_QUEUED            5 | 
|---|
| 110 | #define REQSTATE_RESP_GOT               6 | 
|---|
| 111 | #define REQSTATE_DONE                   6 | 
|---|
| 112 |  | 
|---|
| 113 | void STUBMGR_Start(); | 
|---|
| 114 |  | 
|---|
| 115 | extern HRESULT PIPE_GetNewPipeBuf(wine_marshal_id *mid, IRpcChannelBuffer **pipebuf); | 
|---|
| 116 |  | 
|---|
| 117 | /* This function initialize the Running Object Table */ | 
|---|
| 118 | HRESULT WINAPI RunningObjectTableImpl_Initialize(); | 
|---|
| 119 |  | 
|---|
| 120 | /* This function uninitialize the Running Object Table */ | 
|---|
| 121 | HRESULT WINAPI RunningObjectTableImpl_UnInitialize(); | 
|---|
| 122 |  | 
|---|
| 123 | /* This function decomposes a String path to a String Table containing all the elements ("\" or "subDirectory" or "Directory" or "FileName") of the path */ | 
|---|
| 124 | int WINAPI FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR** stringTable); | 
|---|
| 125 |  | 
|---|
| 126 | #endif /* __WINE_OLE_COMPOBJ_H */ | 
|---|