| 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 |  | 
|---|
| 23 | #ifndef __WINE_OLE_COMPOBJ_H | 
|---|
| 24 | #define __WINE_OLE_COMPOBJ_H | 
|---|
| 25 |  | 
|---|
| 26 | #ifdef __WIN32OS2__ | 
|---|
| 27 | #undef inline | 
|---|
| 28 | #define inline | 
|---|
| 29 |  | 
|---|
| 30 | #include "wine/obj_moniker.h" | 
|---|
| 31 |  | 
|---|
| 32 | #endif | 
|---|
| 33 |  | 
|---|
| 34 | /* All private prototype functions used by OLE will be added to this header file */ | 
|---|
| 35 |  | 
|---|
| 36 | #include "wtypes.h" | 
|---|
| 37 |  | 
|---|
| 38 | extern HRESULT WINE_StringFromCLSID(const CLSID *id,LPSTR idstr); | 
|---|
| 39 | extern HRESULT create_marshalled_proxy(REFCLSID rclsid, REFIID iid, LPVOID *ppv); | 
|---|
| 40 |  | 
|---|
| 41 | inline static HRESULT | 
|---|
| 42 | get_facbuf_for_iid(REFIID riid,IPSFactoryBuffer **facbuf) { | 
|---|
| 43 | HRESULT       hres; | 
|---|
| 44 | CLSID         pxclsid; | 
|---|
| 45 |  | 
|---|
| 46 | if ((hres = CoGetPSClsid(riid,&pxclsid))) | 
|---|
| 47 | return hres; | 
|---|
| 48 | return CoGetClassObject(&pxclsid,CLSCTX_INPROC_SERVER,NULL,&IID_IPSFactoryBuffer,(LPVOID*)facbuf); | 
|---|
| 49 | } | 
|---|
| 50 |  | 
|---|
| 51 | #define PIPEPREF "\\\\.\\pipe\\" | 
|---|
| 52 | #define OLESTUBMGR PIPEPREF"WINE_OLE_StubMgr" | 
|---|
| 53 | /* Standard Marshaling definitions */ | 
|---|
| 54 | typedef struct _wine_marshal_id { | 
|---|
| 55 | DWORD       processid; | 
|---|
| 56 | DWORD       objectid;       /* unique value corresp. IUnknown of object */ | 
|---|
| 57 | IID         iid; | 
|---|
| 58 | } wine_marshal_id; | 
|---|
| 59 |  | 
|---|
| 60 | inline static BOOL | 
|---|
| 61 | MARSHAL_Compare_Mids(wine_marshal_id *mid1,wine_marshal_id *mid2) { | 
|---|
| 62 | return | 
|---|
| 63 | (mid1->processid == mid2->processid)    && | 
|---|
| 64 | (mid1->objectid == mid2->objectid)      && | 
|---|
| 65 | IsEqualIID(&(mid1->iid),&(mid2->iid)) | 
|---|
| 66 | ; | 
|---|
| 67 | } | 
|---|
| 68 |  | 
|---|
| 69 | /* compare without interface compare */ | 
|---|
| 70 | inline static BOOL | 
|---|
| 71 | MARSHAL_Compare_Mids_NoInterface(wine_marshal_id *mid1, wine_marshal_id *mid2) { | 
|---|
| 72 | return | 
|---|
| 73 | (mid1->processid == mid2->processid)    && | 
|---|
| 74 | (mid1->objectid == mid2->objectid) | 
|---|
| 75 | ; | 
|---|
| 76 | } | 
|---|
| 77 |  | 
|---|
| 78 | HRESULT MARSHAL_Find_Stub_Buffer(wine_marshal_id *mid,IRpcStubBuffer **stub); | 
|---|
| 79 | HRESULT MARSHAL_Find_Stub_Server(wine_marshal_id *mid,LPUNKNOWN *punk); | 
|---|
| 80 | HRESULT MARSHAL_Register_Stub(wine_marshal_id *mid,LPUNKNOWN punk, IRpcStubBuffer *stub); | 
|---|
| 81 |  | 
|---|
| 82 | HRESULT MARSHAL_GetStandardMarshalCF(LPVOID *ppv); | 
|---|
| 83 |  | 
|---|
| 84 | typedef struct _wine_marshal_data { | 
|---|
| 85 | DWORD       dwDestContext; | 
|---|
| 86 | DWORD       mshlflags; | 
|---|
| 87 | } wine_marshal_data; | 
|---|
| 88 |  | 
|---|
| 89 |  | 
|---|
| 90 | #define REQTYPE_REQUEST         0 | 
|---|
| 91 | typedef struct _wine_rpc_request_header { | 
|---|
| 92 | DWORD               reqid; | 
|---|
| 93 | wine_marshal_id     mid; | 
|---|
| 94 | DWORD               iMethod; | 
|---|
| 95 | DWORD               cbBuffer; | 
|---|
| 96 | } wine_rpc_request_header; | 
|---|
| 97 |  | 
|---|
| 98 | #define REQTYPE_RESPONSE        1 | 
|---|
| 99 | typedef struct _wine_rpc_response_header { | 
|---|
| 100 | DWORD               reqid; | 
|---|
| 101 | DWORD               cbBuffer; | 
|---|
| 102 | DWORD               retval; | 
|---|
| 103 | } wine_rpc_response_header; | 
|---|
| 104 |  | 
|---|
| 105 | #define REQSTATE_START                  0 | 
|---|
| 106 | #define REQSTATE_REQ_QUEUED             1 | 
|---|
| 107 | #define REQSTATE_REQ_WAITING_FOR_REPLY  2 | 
|---|
| 108 | #define REQSTATE_REQ_GOT                3 | 
|---|
| 109 | #define REQSTATE_INVOKING               4 | 
|---|
| 110 | #define REQSTATE_RESP_QUEUED            5 | 
|---|
| 111 | #define REQSTATE_RESP_GOT               6 | 
|---|
| 112 | #define REQSTATE_DONE                   6 | 
|---|
| 113 |  | 
|---|
| 114 | void STUBMGR_Start(); | 
|---|
| 115 |  | 
|---|
| 116 | extern HRESULT PIPE_GetNewPipeBuf(wine_marshal_id *mid, IRpcChannelBuffer **pipebuf); | 
|---|
| 117 |  | 
|---|
| 118 | /* This function initialize the Running Object Table */ | 
|---|
| 119 | HRESULT WINAPI RunningObjectTableImpl_Initialize(); | 
|---|
| 120 |  | 
|---|
| 121 | /* This function uninitialize the Running Object Table */ | 
|---|
| 122 | HRESULT WINAPI RunningObjectTableImpl_UnInitialize(); | 
|---|
| 123 |  | 
|---|
| 124 | /* This function decomposes a String path to a String Table containing all the elements ("\" or "subDirectory" or "Directory" or "FileName") of the path */ | 
|---|
| 125 | int WINAPI FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR** stringTable); | 
|---|
| 126 |  | 
|---|
| 127 | HRESULT WINAPI __CLSIDFromStringA(LPCSTR idstr, CLSID *id); | 
|---|
| 128 |  | 
|---|
| 129 | #endif /* __WINE_OLE_COMPOBJ_H */ | 
|---|