Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

193 lines
4.3 KiB

  1. #ifndef _OLETHUNK_H_
  2. #define _OLETHUNK_H_
  3. //
  4. // String Conversion Helpers
  5. //
  6. STDAPI_(void) CopyAndFreeOLESTR(LPOLESTR polestr, char **pszOut);
  7. STDAPI_(void) CopyAndFreeSTR(LPSTR polestr, LPOLESTR *pszOut);
  8. STDAPI_(LPOLESTR) CreateOLESTR(const char *pszIn);
  9. STDAPI_(LPSTR) CreateSTR(LPCOLESTR pszIn);
  10. #define CREATEOLESTR(x, y) LPOLESTR x = CreateOLESTR(y);
  11. #define CREATESTR(x, y) LPSTR x = CreateSTR(y);
  12. #define FREEOLESTR(x) CopyAndFreeOLESTR(x, NULL);
  13. #define FREESTR(x) CopyAndFreeSTR(x, NULL);
  14. //
  15. // OLE API Thunks
  16. //
  17. STDAPI_(void) CLSIDFromStringA(LPSTR pszClass, LPCLSID pclsid);
  18. STDAPI CLSIDFromProgIDA(LPCSTR lpszProgID, LPCLSID lpclsid);
  19. STDAPI CreateFileMonikerA(LPSTR lpszPathName, LPMONIKER FAR* ppmk);
  20. STDAPI CreateItemMonikerA(
  21. LPSTR lpszDelim,
  22. LPSTR lpszItem,
  23. LPMONIKER FAR* ppmk);
  24. STDAPI GetClassFileA(LPCSTR szFilename, CLSID FAR* pclsid);
  25. STDAPI MkParseDisplayNameA(
  26. LPBC pbc,
  27. LPSTR szUserName,
  28. ULONG FAR * pchEaten,
  29. LPMONIKER FAR * ppmk);
  30. STDAPI OleCreateFromFileA(
  31. REFCLSID rclsid,
  32. LPCSTR lpszFileName,
  33. REFIID riid,
  34. DWORD renderopt,
  35. LPFORMATETC lpFormatEtc,
  36. LPOLECLIENTSITE pClientSite,
  37. LPSTORAGE pStg,
  38. LPVOID FAR* ppvObj);
  39. STDAPI OleCreateLinkToFileA(
  40. LPCSTR lpszFileName,
  41. REFIID riid,
  42. DWORD renderopt,
  43. LPFORMATETC lpFormatEtc,
  44. LPOLECLIENTSITE pClientSite,
  45. LPSTORAGE pStg,
  46. LPVOID FAR* ppvObj);
  47. STDAPI_(HGLOBAL) OleGetIconOfClassA(
  48. REFCLSID rclsid,
  49. LPSTR lpszLabel,
  50. BOOL fUseTypeAsLabel);
  51. STDAPI_(HGLOBAL) OleGetIconOfFileA(LPSTR lpszPath, BOOL fUseFileAsLabel);
  52. STDAPI_(HGLOBAL) OleMetafilePictFromIconAndLabelA(
  53. HICON hIcon,
  54. LPSTR lpszLabel,
  55. LPSTR lpszSourceFile,
  56. UINT iIconIndex);
  57. STDAPI OleRegGetUserTypeA(
  58. REFCLSID clsid,
  59. DWORD dwFormOfType,
  60. LPSTR FAR* pszUserType);
  61. STDAPI ProgIDFromCLSIDA(REFCLSID clsid, LPSTR FAR* lplpszProgID);
  62. STDAPI ReadFmtUserTypeStgA(
  63. LPSTORAGE pstg,
  64. CLIPFORMAT FAR* pcf,
  65. LPSTR FAR* lplpszUserType);
  66. STDAPI StgCreateDocfileA(
  67. LPCSTR pwcsName,
  68. DWORD grfMode,
  69. DWORD reserved,
  70. IStorage FAR * FAR *ppstgOpen);
  71. STDAPI StgOpenStorageA(
  72. LPCSTR pwcsName,
  73. IStorage FAR *pstgPriority,
  74. DWORD grfMode,
  75. SNB snbExclude,
  76. DWORD reserved,
  77. IStorage FAR * FAR *ppstgOpen);
  78. STDAPI StgSetTimesA(
  79. LPSTR lpszName,
  80. FILETIME const FAR* pctime,
  81. FILETIME const FAR* patime,
  82. FILETIME const FAR* pmtime);
  83. STDAPI_(void) StringFromCLSIDA(REFCLSID rclsid, LPSTR *lplpszCLSID);
  84. STDAPI WriteFmtUserTypeStgA(
  85. LPSTORAGE pstg,
  86. CLIPFORMAT cf,
  87. LPSTR lpszUserType);
  88. //
  89. // Method Thunks
  90. //
  91. STDAPI CallIMonikerGetDisplayNameA(
  92. LPMONIKER lpmk,
  93. IBindCtx *pbc,
  94. IMoniker *pmkToLeft,
  95. LPSTR *ppszDisplayName);
  96. STDAPI CallIOleLinkGetSourceDisplayNameA(
  97. IOleLink FAR *polelink,
  98. LPSTR *ppszDisplayName);
  99. STDAPI CallIOleLinkSetSourceDisplayNameA(
  100. IOleLink FAR *polelink,
  101. LPCSTR pszStatusText);
  102. STDAPI CallIOleInPlaceFrameSetStatusTextA(
  103. IOleInPlaceFrame *poleinplc,
  104. LPCSTR pszStatusText);
  105. STDAPI CallIOleInPlaceUIWindowSetActiveObjectA(
  106. IOleInPlaceUIWindow FAR *lpthis,
  107. IOleInPlaceActiveObject *pActiveObject,
  108. LPCSTR pszObjName);
  109. STDAPI CallIOleObjectGetUserTypeA(
  110. LPOLEOBJECT lpOleObject,
  111. DWORD dwFormOfType,
  112. LPSTR *pszUserType);
  113. STDAPI CallIOleObjectSetHostNamesA(
  114. LPOLEOBJECT lpOleObject,
  115. LPCSTR szContainerApp,
  116. LPCSTR szContainerObj);
  117. STDAPI CallIStorageCreateStorageA(
  118. LPSTORAGE lpStg,
  119. const char *pwcsName,
  120. DWORD grfMode,
  121. DWORD dwStgFmt,
  122. DWORD reserved2,
  123. IStorage **ppstg);
  124. STDAPI CallIStorageDestroyElementA(
  125. LPSTORAGE lpStg,
  126. LPSTR pszName);
  127. STDAPI CallIStorageOpenStorageA(
  128. LPSTORAGE lpStg,
  129. const char *pszName,
  130. IStorage *pstgPriority,
  131. DWORD grfMode,
  132. SNB snbExclude,
  133. DWORD reserved,
  134. IStorage **ppstg);
  135. STDAPI CallIStorageCreateStreamA(
  136. LPSTORAGE lpStg,
  137. LPSTR pszName,
  138. DWORD grfMode,
  139. DWORD reserved1,
  140. DWORD reserved2,
  141. IStream **ppstm);
  142. STDAPI CallIStorageOpenStreamA(
  143. LPSTORAGE lpStg,
  144. LPSTR pszName,
  145. void *reserved1,
  146. DWORD grfMode,
  147. DWORD reserved2,
  148. IStream **ppstm);
  149. #endif // _OLETHUNK_H_