mstask: Implement GetTargetComputer.
[wine] / dlls / atl / atl_main.c
1 /*
2  * Implementation of Active Template Library (atl.dll)
3  *
4  * Copyright 2004 Aric Stewart for CodeWeavers
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21 #include <stdarg.h>
22 #include <stdio.h>
23
24 #define COBJMACROS
25
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winerror.h"
29 #include "wingdi.h"
30 #include "winuser.h"
31 #include "wine/debug.h"
32 #include "objbase.h"
33 #include "objidl.h"
34 #include "ole2.h"
35 #include "atlbase.h"
36 #include "atliface.h"
37 #include "atlwin.h"
38
39 #include "wine/unicode.h"
40
41 WINE_DEFAULT_DEBUG_CHANNEL(atl);
42
43 DECLSPEC_HIDDEN HINSTANCE hInst;
44
45 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
46 {
47     TRACE("(0x%p, %d, %p)\n",hinstDLL,fdwReason,lpvReserved);
48
49     if (fdwReason == DLL_PROCESS_ATTACH) {
50         DisableThreadLibraryCalls(hinstDLL);
51         hInst = hinstDLL;
52     }
53     return TRUE;
54 }
55
56 #define ATLVer1Size FIELD_OFFSET(_ATL_MODULEW, dwAtlBuildVer)
57
58 HRESULT WINAPI AtlModuleInit(_ATL_MODULEW* pM, _ATL_OBJMAP_ENTRYW* p, HINSTANCE h)
59 {
60     INT i;
61     UINT size;
62
63     FIXME("SEMI-STUB (%p %p %p)\n",pM,p,h);
64
65     size = pM->cbSize;
66     switch (size)
67     {
68     case ATLVer1Size:
69     case sizeof(_ATL_MODULEW):
70 #ifdef _WIN64
71     case sizeof(_ATL_MODULEW) + sizeof(void *):
72 #endif
73         break;
74     default:
75         WARN("Unknown structure version (size %i)\n",size);
76         return E_INVALIDARG;
77     }
78
79     memset(pM,0,pM->cbSize);
80     pM->cbSize = size;
81     pM->m_hInst = h;
82     pM->m_hInstResource = h;
83     pM->m_hInstTypeLib = h;
84     pM->m_pObjMap = p;
85     pM->m_hHeap = GetProcessHeap();
86
87     InitializeCriticalSection(&pM->u.m_csTypeInfoHolder);
88     InitializeCriticalSection(&pM->m_csWindowCreate);
89     InitializeCriticalSection(&pM->m_csObjMap);
90
91     /* call mains */
92     i = 0;
93     if (pM->m_pObjMap != NULL  && size > ATLVer1Size)
94     {
95         while (pM->m_pObjMap[i].pclsid != NULL)
96         {
97             TRACE("Initializing object %i %p\n",i,p[i].pfnObjectMain);
98             if (p[i].pfnObjectMain)
99                 p[i].pfnObjectMain(TRUE);
100             i++;
101         }
102     }
103
104     return S_OK;
105 }
106
107 static _ATL_OBJMAP_ENTRYW_V1 *get_objmap_entry( _ATL_MODULEW *mod, unsigned int index )
108 {
109     _ATL_OBJMAP_ENTRYW_V1 *ret;
110
111     if (mod->cbSize == ATLVer1Size)
112         ret = (_ATL_OBJMAP_ENTRYW_V1 *)mod->m_pObjMap + index;
113     else
114         ret = (_ATL_OBJMAP_ENTRYW_V1 *)(mod->m_pObjMap + index);
115
116     if (!ret->pclsid) ret = NULL;
117     return ret;
118 }
119
120 HRESULT WINAPI AtlModuleLoadTypeLib(_ATL_MODULEW *pM, LPCOLESTR lpszIndex,
121                                     BSTR *pbstrPath, ITypeLib **ppTypeLib)
122 {
123     HRESULT hRes;
124     OLECHAR path[MAX_PATH+8]; /* leave some space for index */
125
126     TRACE("(%p, %s, %p, %p)\n", pM, debugstr_w(lpszIndex), pbstrPath, ppTypeLib);
127
128     if (!pM)
129         return E_INVALIDARG;
130
131     GetModuleFileNameW(pM->m_hInstTypeLib, path, MAX_PATH);
132     if (lpszIndex)
133         lstrcatW(path, lpszIndex);
134
135     hRes = LoadTypeLib(path, ppTypeLib);
136     if (FAILED(hRes))
137         return hRes;
138
139     *pbstrPath = SysAllocString(path);
140
141     return S_OK;
142 }
143
144 HRESULT WINAPI AtlModuleTerm(_ATL_MODULEW* pM)
145 {
146     _ATL_TERMFUNC_ELEM *iter = pM->m_pTermFuncs, *tmp;
147
148     TRACE("(%p)\n", pM);
149
150     while(iter) {
151         iter->pFunc(iter->dw);
152         tmp = iter;
153         iter = iter->pNext;
154         HeapFree(GetProcessHeap(), 0, tmp);
155     }
156
157     HeapFree(GetProcessHeap(), 0, pM);
158
159     return S_OK;
160 }
161
162 HRESULT WINAPI AtlModuleAddTermFunc(_ATL_MODULEW *pM, _ATL_TERMFUNC *pFunc, DWORD_PTR dw)
163 {
164     _ATL_TERMFUNC_ELEM *termfunc_elem;
165
166     TRACE("(%p %p %ld)\n", pM, pFunc, dw);
167
168     termfunc_elem = HeapAlloc(GetProcessHeap(), 0, sizeof(_ATL_TERMFUNC_ELEM));
169     termfunc_elem->pFunc = pFunc;
170     termfunc_elem->dw = dw;
171     termfunc_elem->pNext = pM->m_pTermFuncs;
172
173     pM->m_pTermFuncs = termfunc_elem;
174
175     return S_OK;
176 }
177
178 HRESULT WINAPI AtlModuleRegisterClassObjects(_ATL_MODULEW *pM, DWORD dwClsContext,
179                                              DWORD dwFlags)
180 {
181     _ATL_OBJMAP_ENTRYW_V1 *obj;
182     int i=0;
183
184     TRACE("(%p %i %i)\n",pM, dwClsContext, dwFlags);
185
186     if (pM == NULL)
187         return E_INVALIDARG;
188
189     while ((obj = get_objmap_entry( pM, i++ )))
190     {
191         IUnknown* pUnknown;
192         HRESULT rc;
193
194         TRACE("Registering object %i\n",i);
195         if (obj->pfnGetClassObject)
196         {
197             rc = obj->pfnGetClassObject(obj->pfnCreateInstance, &IID_IUnknown,
198                                    (LPVOID*)&pUnknown);
199             if (SUCCEEDED (rc) )
200             {
201                 rc = CoRegisterClassObject(obj->pclsid, pUnknown, dwClsContext,
202                                            dwFlags, &obj->dwRegister);
203
204                 if (FAILED (rc) )
205                     WARN("Failed to register object %i: 0x%08x\n", i, rc);
206
207                 if (pUnknown)
208                     IUnknown_Release(pUnknown);
209             }
210         }
211     }
212
213    return S_OK;
214 }
215
216 HRESULT WINAPI AtlModuleUnregisterServerEx(_ATL_MODULEW* pM, BOOL bUnRegTypeLib, const CLSID* pCLSID)
217 {
218     FIXME("(%p, %i, %p) stub\n", pM, bUnRegTypeLib, pCLSID);
219     return S_OK;
220 }
221
222
223 IUnknown* WINAPI AtlComPtrAssign(IUnknown** pp, IUnknown *p)
224 {
225     TRACE("(%p %p)\n", pp, p);
226
227     if (p) IUnknown_AddRef(p);
228     if (*pp) IUnknown_Release(*pp);
229     *pp = p;
230     return p;
231 }
232
233 IUnknown* WINAPI AtlComQIPtrAssign(IUnknown** pp, IUnknown *p, REFIID riid)
234 {
235     IUnknown *new_p = NULL;
236
237     TRACE("(%p %p %s)\n", pp, p, debugstr_guid(riid));
238
239     if (p) IUnknown_QueryInterface(p, riid, (void **)&new_p);
240     if (*pp) IUnknown_Release(*pp);
241     *pp = new_p;
242     return new_p;
243 }
244
245
246 HRESULT WINAPI AtlInternalQueryInterface(void* this, const _ATL_INTMAP_ENTRY* pEntries,  REFIID iid, void** ppvObject)
247 {
248     int i = 0;
249     HRESULT rc = E_NOINTERFACE;
250     TRACE("(%p, %p, %s, %p)\n",this, pEntries, debugstr_guid(iid), ppvObject);
251
252     if (IsEqualGUID(iid,&IID_IUnknown))
253     {
254         TRACE("Returning IUnknown\n");
255         *ppvObject = ((LPSTR)this+pEntries[0].dw);
256         IUnknown_AddRef((IUnknown*)*ppvObject);
257         return S_OK;
258     }
259
260     while (pEntries[i].pFunc != 0)
261     {
262         TRACE("Trying entry %i (%s %i %p)\n",i,debugstr_guid(pEntries[i].piid),
263               pEntries[i].dw, pEntries[i].pFunc);
264
265         if (!pEntries[i].piid || IsEqualGUID(iid,pEntries[i].piid))
266         {
267             TRACE("MATCH\n");
268             if (pEntries[i].pFunc == (_ATL_CREATORARGFUNC*)1)
269             {
270                 TRACE("Offset\n");
271                 *ppvObject = ((LPSTR)this+pEntries[i].dw);
272                 IUnknown_AddRef((IUnknown*)*ppvObject);
273                 return S_OK;
274             }
275             else
276             {
277                 TRACE("Function\n");
278                 rc = pEntries[i].pFunc(this, iid, ppvObject, pEntries[i].dw);
279                 if(rc==S_OK || pEntries[i].piid)
280                     return rc;
281             }
282         }
283         i++;
284     }
285     TRACE("Done returning (0x%x)\n",rc);
286     return rc;
287 }
288
289 /***********************************************************************
290  *           AtlModuleRegisterServer         [ATL.@]
291  *
292  */
293 HRESULT WINAPI AtlModuleRegisterServer(_ATL_MODULEW* pM, BOOL bRegTypeLib, const CLSID* clsid)
294 {
295     const _ATL_OBJMAP_ENTRYW_V1 *obj;
296     int i;
297     HRESULT hRes;
298
299     TRACE("%p %d %s\n", pM, bRegTypeLib, debugstr_guid(clsid));
300
301     if (pM == NULL)
302         return E_INVALIDARG;
303
304     for (i = 0; (obj = get_objmap_entry( pM, i )) != NULL; i++) /* register CLSIDs */
305     {
306         if (!clsid || IsEqualCLSID(obj->pclsid, clsid))
307         {
308             TRACE("Registering clsid %s\n", debugstr_guid(obj->pclsid));
309             hRes = obj->pfnUpdateRegistry(TRUE); /* register */
310             if (FAILED(hRes))
311                 return hRes;
312         }
313     }
314
315     if (bRegTypeLib)
316     {
317         hRes = AtlModuleRegisterTypeLib(pM, NULL);
318         if (FAILED(hRes))
319             return hRes;
320     }
321
322     return S_OK;
323 }
324
325 /***********************************************************************
326  *           AtlAdvise         [ATL.@]
327  */
328 HRESULT WINAPI AtlAdvise(IUnknown *pUnkCP, IUnknown *pUnk, const IID *iid, LPDWORD pdw)
329 {
330     FIXME("%p %p %p %p\n", pUnkCP, pUnk, iid, pdw);
331     return E_FAIL;
332 }
333
334 /***********************************************************************
335  *           AtlUnadvise         [ATL.@]
336  */
337 HRESULT WINAPI AtlUnadvise(IUnknown *pUnkCP, const IID *iid, DWORD dw)
338 {
339     FIXME("%p %p %d\n", pUnkCP, iid, dw);
340     return S_OK;
341 }
342
343 /***********************************************************************
344  *           AtlFreeMarshalStream         [ATL.@]
345  */
346 HRESULT WINAPI AtlFreeMarshalStream(IStream *stm)
347 {
348     FIXME("%p\n", stm);
349     return S_OK;
350 }
351
352 /***********************************************************************
353  *           AtlMarshalPtrInProc         [ATL.@]
354  */
355 HRESULT WINAPI AtlMarshalPtrInProc(IUnknown *pUnk, const IID *iid, IStream **pstm)
356 {
357     FIXME("%p %p %p\n", pUnk, iid, pstm);
358     return E_FAIL;
359 }
360
361 /***********************************************************************
362  *           AtlUnmarshalPtr              [ATL.@]
363  */
364 HRESULT WINAPI AtlUnmarshalPtr(IStream *stm, const IID *iid, IUnknown **ppUnk)
365 {
366     FIXME("%p %p %p\n", stm, iid, ppUnk);
367     return E_FAIL;
368 }
369
370 /***********************************************************************
371  *           AtlModuleGetClassObject              [ATL.@]
372  */
373 HRESULT WINAPI AtlModuleGetClassObject(_ATL_MODULEW *pm, REFCLSID rclsid,
374                                        REFIID riid, LPVOID *ppv)
375 {
376     _ATL_OBJMAP_ENTRYW_V1 *obj;
377     int i;
378     HRESULT hres = CLASS_E_CLASSNOTAVAILABLE;
379
380     TRACE("%p %s %s %p\n", pm, debugstr_guid(rclsid), debugstr_guid(riid), ppv);
381
382     if (pm == NULL)
383         return E_INVALIDARG;
384
385     for (i = 0; (obj = get_objmap_entry( pm, i )) != NULL; i++)
386     {
387         if (IsEqualCLSID(obj->pclsid, rclsid))
388         {
389             TRACE("found object %i\n", i);
390             if (obj->pfnGetClassObject)
391             {
392                 if (!obj->pCF)
393                     hres = obj->pfnGetClassObject(obj->pfnCreateInstance,
394                                                   &IID_IUnknown,
395                                                   (void **)&obj->pCF);
396                 if (obj->pCF)
397                     hres = IUnknown_QueryInterface(obj->pCF, riid, ppv);
398                 break;
399             }
400         }
401     }
402
403     WARN("no class object found for %s\n", debugstr_guid(rclsid));
404
405     return hres;
406 }
407
408 /***********************************************************************
409  *           AtlModuleGetClassObject              [ATL.@]
410  */
411 HRESULT WINAPI AtlModuleRegisterTypeLib(_ATL_MODULEW *pm, LPCOLESTR lpszIndex)
412 {
413     HRESULT hRes;
414     BSTR path;
415     ITypeLib *typelib;
416
417     TRACE("%p %s\n", pm, debugstr_w(lpszIndex));
418
419     if (!pm)
420         return E_INVALIDARG;
421
422     hRes = AtlModuleLoadTypeLib(pm, lpszIndex, &path, &typelib);
423
424     if (SUCCEEDED(hRes))
425     {
426         hRes = RegisterTypeLib(typelib, path, NULL); /* FIXME: pass help directory */
427         ITypeLib_Release(typelib);
428         SysFreeString(path);
429     }
430
431     return hRes;
432 }
433
434 /***********************************************************************
435  *           AtlModuleRevokeClassObjects          [ATL.@]
436  */
437 HRESULT WINAPI AtlModuleRevokeClassObjects(_ATL_MODULEW *pm)
438 {
439     FIXME("%p\n", pm);
440     return E_FAIL;
441 }
442
443 /***********************************************************************
444  *           AtlModuleUnregisterServer           [ATL.@]
445  */
446 HRESULT WINAPI AtlModuleUnregisterServer(_ATL_MODULEW *pm, const CLSID *clsid)
447 {
448     FIXME("%p %s\n", pm, debugstr_guid(clsid));
449     return E_FAIL;
450 }
451
452 /***********************************************************************
453  *           AtlModuleRegisterWndClassInfoA           [ATL.@]
454  *
455  * See AtlModuleRegisterWndClassInfoW.
456  */
457 ATOM WINAPI AtlModuleRegisterWndClassInfoA(_ATL_MODULEA *pm, _ATL_WNDCLASSINFOA *wci, WNDPROC *pProc)
458 {
459     ATOM atom;
460
461     FIXME("%p %p %p semi-stub\n", pm, wci, pProc);
462
463     atom = wci->m_atom;
464     if (!atom)
465     {
466         WNDCLASSEXA wc;
467
468         TRACE("wci->m_wc.lpszClassName = %s\n", wci->m_wc.lpszClassName);
469
470         if (wci->m_lpszOrigName)
471             FIXME( "subclassing %s not implemented\n", debugstr_a(wci->m_lpszOrigName));
472
473         if (!wci->m_wc.lpszClassName)
474         {
475             snprintf(wci->m_szAutoName, sizeof(wci->m_szAutoName), "ATL%08lx", (UINT_PTR)wci);
476             TRACE("auto-generated class name %s\n", wci->m_szAutoName);
477             wci->m_wc.lpszClassName = wci->m_szAutoName;
478         }
479
480         atom = GetClassInfoExA(pm->m_hInst, wci->m_wc.lpszClassName, &wc);
481         if (!atom)
482         {
483             wci->m_wc.hInstance = pm->m_hInst;
484             wci->m_wc.hCursor   = LoadCursorA( wci->m_bSystemCursor ? NULL : pm->m_hInst,
485                                                wci->m_lpszCursorID );
486             atom = RegisterClassExA(&wci->m_wc);
487         }
488         wci->pWndProc = wci->m_wc.lpfnWndProc;
489         wci->m_atom = atom;
490     }
491
492     if (wci->m_lpszOrigName) *pProc = wci->pWndProc;
493
494     TRACE("returning 0x%04x\n", atom);
495     return atom;
496 }
497
498 /***********************************************************************
499  *           AtlModuleRegisterWndClassInfoW           [ATL.@]
500  *
501  * PARAMS
502  *  pm   [IO] Information about the module registering the window.
503  *  wci  [IO] Information about the window being registered.
504  *  pProc [O] Window procedure of the registered class.
505  *
506  * RETURNS
507  *  Atom representing the registered class.
508  *
509  * NOTES
510  *  Can be called multiple times without error, unlike RegisterClassEx().
511  *
512  *  If the class name is NULL, then a class with a name of "ATLxxxxxxxx" is
513  *  registered, where the 'x's represent a unique value.
514  *
515  */
516 ATOM WINAPI AtlModuleRegisterWndClassInfoW(_ATL_MODULEW *pm, _ATL_WNDCLASSINFOW *wci, WNDPROC *pProc)
517 {
518     ATOM atom;
519
520     FIXME("%p %p %p semi-stub\n", pm, wci, pProc);
521
522     atom = wci->m_atom;
523     if (!atom)
524     {
525         WNDCLASSEXW wc;
526
527         TRACE("wci->m_wc.lpszClassName = %s\n", debugstr_w(wci->m_wc.lpszClassName));
528
529         if (wci->m_lpszOrigName)
530             FIXME( "subclassing %s not implemented\n", debugstr_w(wci->m_lpszOrigName));
531
532         if (!wci->m_wc.lpszClassName)
533         {
534             static const WCHAR szFormat[] = {'A','T','L','%','0','8','l','x',0};
535             snprintfW(wci->m_szAutoName, sizeof(wci->m_szAutoName)/sizeof(WCHAR), szFormat, (UINT_PTR)wci);
536             TRACE("auto-generated class name %s\n", debugstr_w(wci->m_szAutoName));
537             wci->m_wc.lpszClassName = wci->m_szAutoName;
538         }
539
540         atom = GetClassInfoExW(pm->m_hInst, wci->m_wc.lpszClassName, &wc);
541         if (!atom)
542         {
543             wci->m_wc.hInstance = pm->m_hInst;
544             wci->m_wc.hCursor   = LoadCursorW( wci->m_bSystemCursor ? NULL : pm->m_hInst,
545                                                wci->m_lpszCursorID );
546             atom = RegisterClassExW(&wci->m_wc);
547         }
548         wci->pWndProc = wci->m_wc.lpfnWndProc;
549         wci->m_atom = atom;
550     }
551
552     if (wci->m_lpszOrigName) *pProc = wci->pWndProc;
553
554     TRACE("returning 0x%04x\n", atom);
555     return atom;
556 }
557
558 void WINAPI AtlHiMetricToPixel(const SIZEL* lpHiMetric, SIZEL* lpPix)
559 {
560     HDC dc = GetDC(NULL);
561     lpPix->cx = lpHiMetric->cx * GetDeviceCaps( dc, LOGPIXELSX ) / 100;
562     lpPix->cy = lpHiMetric->cy * GetDeviceCaps( dc, LOGPIXELSY ) / 100;
563     ReleaseDC( NULL, dc );
564 }
565
566 void WINAPI AtlPixelToHiMetric(const SIZEL* lpPix, SIZEL* lpHiMetric)
567 {
568     HDC dc = GetDC(NULL);
569     lpHiMetric->cx = 100 * lpPix->cx / GetDeviceCaps( dc, LOGPIXELSX );
570     lpHiMetric->cy = 100 * lpPix->cy / GetDeviceCaps( dc, LOGPIXELSY );
571     ReleaseDC( NULL, dc );
572 }
573
574 /***********************************************************************
575  *           AtlCreateTargetDC         [ATL.@]
576  */
577 HDC WINAPI AtlCreateTargetDC( HDC hdc, DVTARGETDEVICE *dv )
578 {
579     static const WCHAR displayW[] = {'d','i','s','p','l','a','y',0};
580     const WCHAR *driver = NULL, *device = NULL, *port = NULL;
581     DEVMODEW *devmode = NULL;
582
583     TRACE( "(%p, %p)\n", hdc, dv );
584
585     if (dv)
586     {
587         if (dv->tdDriverNameOffset) driver  = (WCHAR *)((char *)dv + dv->tdDriverNameOffset);
588         if (dv->tdDeviceNameOffset) device  = (WCHAR *)((char *)dv + dv->tdDeviceNameOffset);
589         if (dv->tdPortNameOffset)   port    = (WCHAR *)((char *)dv + dv->tdPortNameOffset);
590         if (dv->tdExtDevmodeOffset) devmode = (DEVMODEW *)((char *)dv + dv->tdExtDevmodeOffset);
591     }
592     else
593     {
594         if (hdc) return hdc;
595         driver = displayW;
596     }
597     return CreateDCW( driver, device, port, devmode );
598 }
599
600 /***********************************************************************
601  *           AtlModuleAddCreateWndData          [ATL.@]
602  */
603 void WINAPI AtlModuleAddCreateWndData(_ATL_MODULEW *pM, _AtlCreateWndData *pData, void* pvObject)
604 {
605     TRACE("(%p, %p, %p)\n", pM, pData, pvObject);
606
607     pData->m_pThis = pvObject;
608     pData->m_dwThreadID = GetCurrentThreadId();
609     pData->m_pNext = pM->m_pCreateWndList;
610     pM->m_pCreateWndList = pData;
611 }
612
613 /***********************************************************************
614  *           AtlModuleExtractCreateWndData      [ATL.@]
615  *
616  *  NOTE: I failed to find any good description of this function.
617  *        Tests show that this function extracts one of _AtlCreateWndData
618  *        records from the current thread from a list
619  *
620  */
621 void* WINAPI AtlModuleExtractCreateWndData(_ATL_MODULEW *pM)
622 {
623     _AtlCreateWndData **ppData;
624
625     TRACE("(%p)\n", pM);
626
627     for(ppData = &pM->m_pCreateWndList; *ppData!=NULL; ppData = &(*ppData)->m_pNext)
628     {
629         if ((*ppData)->m_dwThreadID == GetCurrentThreadId())
630         {
631             _AtlCreateWndData *pData = *ppData;
632             *ppData = pData->m_pNext;
633             return pData->m_pThis;
634         }
635     }
636     return NULL;
637 }
638
639 /* FIXME: should be in a header file */
640 typedef struct ATL_PROPMAP_ENTRY
641 {
642     LPCOLESTR szDesc;
643     DISPID dispid;
644     const CLSID* pclsidPropPage;
645     const IID* piidDispatch;
646     DWORD dwOffsetData;
647     DWORD dwSizeData;
648     VARTYPE vt;
649 } ATL_PROPMAP_ENTRY;
650
651 /***********************************************************************
652  *           AtlIPersistStreamInit_Load      [ATL.@]
653  */
654 HRESULT WINAPI AtlIPersistStreamInit_Load( LPSTREAM pStm, ATL_PROPMAP_ENTRY *pMap,
655                                            void *pThis, IUnknown *pUnk)
656 {
657     FIXME("(%p, %p, %p, %p)\n", pStm, pMap, pThis, pUnk);
658
659     return S_OK;
660 }
661
662 HRESULT WINAPI AtlIPersistStreamInit_Save(LPSTREAM pStm, BOOL fClearDirty,
663                                           ATL_PROPMAP_ENTRY *pMap, void *pThis,
664                                           IUnknown *pUnk)
665 {
666     FIXME("(%p, %d, %p, %p, %p)\n", pStm, fClearDirty, pMap, pThis, pUnk);
667
668     return S_OK;
669 }