Source code of Windows XP (NT5)
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.

515 lines
8.3 KiB

  1. #include "compch.h"
  2. #pragma hdrstop
  3. #define _OLEAUT32_
  4. #include <oleauto.h>
  5. #include <olectl.h>
  6. #undef WINOLEAUTAPI
  7. #define WINOLEAUTAPI HRESULT STDAPICALLTYPE
  8. #undef WINOLECTLAPI
  9. #define WINOLECTLAPI HRESULT STDAPICALLTYPE
  10. #undef WINOLEAUTAPI_
  11. #define WINOLEAUTAPI_(type) type STDAPICALLTYPE
  12. static
  13. STDMETHODIMP_(BSTR)
  14. SysAllocString(
  15. const OLECHAR * string
  16. )
  17. {
  18. return NULL;
  19. }
  20. static
  21. STDMETHODIMP_(void)
  22. SysFreeString(
  23. BSTR bstrString
  24. )
  25. {
  26. return;
  27. }
  28. static
  29. STDMETHODIMP_(void)
  30. VariantInit(
  31. VARIANTARG * pvarg
  32. )
  33. {
  34. pvarg->vt = VT_EMPTY;
  35. return;
  36. }
  37. static
  38. STDMETHODIMP
  39. VariantClear(
  40. VARIANTARG * pvarg
  41. )
  42. {
  43. pvarg->vt = VT_EMPTY;
  44. return HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND);
  45. }
  46. static
  47. STDMETHODIMP_(BSTR)
  48. SysAllocStringByteLen(
  49. LPCSTR psz,
  50. UINT len
  51. )
  52. {
  53. return NULL;
  54. }
  55. static
  56. STDMETHODIMP_(UINT)
  57. SafeArrayGetDim(
  58. SAFEARRAY * psa
  59. )
  60. {
  61. return 0;
  62. }
  63. static
  64. STDMETHODIMP_(UINT)
  65. SysStringByteLen(
  66. BSTR bstr
  67. )
  68. {
  69. return 0;
  70. }
  71. static
  72. STDMETHODIMP_(SAFEARRAY *)
  73. SafeArrayCreateVector(
  74. VARTYPE vt,
  75. LONG lLbound,
  76. ULONG cElements
  77. )
  78. {
  79. return NULL;
  80. }
  81. static
  82. STDMETHODIMP_(SAFEARRAY *)
  83. SafeArrayCreate(
  84. VARTYPE vt,
  85. UINT cDims,
  86. SAFEARRAYBOUND * rgsabound
  87. )
  88. {
  89. return NULL;
  90. }
  91. static
  92. STDMETHODIMP
  93. SafeArrayCopy(
  94. SAFEARRAY * psa,
  95. SAFEARRAY ** ppsaOut
  96. )
  97. {
  98. return HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND);
  99. }
  100. static
  101. STDMETHODIMP
  102. SafeArrayPutElement(
  103. SAFEARRAY * psa,
  104. LONG * rgIndices,
  105. void * pv
  106. )
  107. {
  108. return HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND);
  109. }
  110. static
  111. STDMETHODIMP
  112. SafeArrayDestroy(
  113. SAFEARRAY * psa
  114. )
  115. {
  116. return HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND);
  117. }
  118. static
  119. STDMETHODIMP
  120. SafeArrayAccessData(
  121. SAFEARRAY * psa,
  122. void HUGEP** ppvData
  123. )
  124. {
  125. return HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND);
  126. }
  127. static
  128. STDMETHODIMP
  129. SafeArrayUnaccessData(
  130. SAFEARRAY * psa
  131. )
  132. {
  133. return HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND);
  134. }
  135. static
  136. STDMETHODIMP_(INT)
  137. VariantTimeToSystemTime(
  138. DOUBLE vtime,
  139. LPSYSTEMTIME lpSystemTime
  140. )
  141. {
  142. return FALSE;
  143. }
  144. static
  145. STDMETHODIMP
  146. OleCreatePropertyFrame(
  147. HWND hwndOwner,
  148. UINT x,
  149. UINT y,
  150. LPCOLESTR lpszCaption,
  151. ULONG cObjects,
  152. LPUNKNOWN FAR* ppUnk,
  153. ULONG cPages,
  154. LPCLSID pPageClsID,
  155. LCID lcid,
  156. DWORD dwReserved,
  157. LPVOID pvReserved)
  158. {
  159. return HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND);
  160. }
  161. static
  162. STDMETHODIMP_(UINT)
  163. SysStringLen(
  164. BSTR bstr
  165. )
  166. {
  167. return 0;
  168. }
  169. static
  170. STDMETHODIMP
  171. LoadRegTypeLib(
  172. REFGUID rguid,
  173. WORD wVerMajor,
  174. WORD wVerMinor,
  175. LCID lcid,
  176. ITypeLib ** pptlib
  177. )
  178. {
  179. return HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND);
  180. }
  181. static
  182. STDMETHODIMP
  183. SetErrorInfo(
  184. ULONG dwReserved,
  185. IErrorInfo * perrinfo
  186. )
  187. {
  188. return HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND);
  189. }
  190. static
  191. STDMETHODIMP_(INT)
  192. SystemTimeToVariantTime(
  193. LPSYSTEMTIME lpSystemTime,
  194. DOUBLE *pvtime
  195. )
  196. {
  197. return 0;
  198. }
  199. static
  200. STDMETHODIMP
  201. VariantCopy(
  202. VARIANTARG * pvargDest,
  203. VARIANTARG * pvargSrc
  204. )
  205. {
  206. return E_OUTOFMEMORY;
  207. }
  208. static
  209. STDMETHODIMP_(INT)
  210. DosDateTimeToVariantTime(
  211. USHORT wDosDate,
  212. USHORT wDosTime,
  213. DOUBLE * pvtime
  214. )
  215. {
  216. return 0;
  217. }
  218. static
  219. STDMETHODIMP_(INT)
  220. VariantTimeToDosDateTime(
  221. DOUBLE vtime,
  222. USHORT * pwDosDate,
  223. USHORT * pwDosTime
  224. )
  225. {
  226. return 0;
  227. }
  228. static
  229. STDMETHODIMP
  230. SafeArrayGetUBound(
  231. SAFEARRAY * psa,
  232. UINT nDim,
  233. LONG * plUbound
  234. )
  235. {
  236. return HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND);
  237. }
  238. static
  239. STDMETHODIMP
  240. VarDiv(
  241. LPVARIANT pvarLeft,
  242. LPVARIANT pvarRight,
  243. LPVARIANT pvarResult)
  244. {
  245. // I bet people don't check the return value
  246. // so do a VariantClear just to be safe
  247. ZeroMemory(pvarResult, sizeof(*pvarResult));
  248. return HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND);
  249. }
  250. static
  251. STDMETHODIMP
  252. VarNeg(
  253. LPVARIANT pvarIn,
  254. LPVARIANT pvarResult)
  255. {
  256. // I bet people don't check the return value
  257. // so do a VariantClear just to be safe
  258. ZeroMemory(pvarResult, sizeof(*pvarResult));
  259. return HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND);
  260. }
  261. static
  262. STDMETHODIMP
  263. VarRound(
  264. LPVARIANT pvarIn,
  265. int cDecimals,
  266. LPVARIANT pvarResult)
  267. {
  268. // I bet people don't check the return value
  269. // so do a VariantClear just to be safe
  270. ZeroMemory(pvarResult, sizeof(*pvarResult));
  271. return HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND);
  272. }
  273. static
  274. STDMETHODIMP
  275. VarCmp(
  276. LPVARIANT pvarLeft,
  277. LPVARIANT pvarRight,
  278. LCID lcid,
  279. ULONG dwFlags
  280. )
  281. {
  282. return VARCMP_NULL;
  283. }
  284. static
  285. STDMETHODIMP
  286. VarMul(
  287. LPVARIANT pvarLeft,
  288. LPVARIANT pvarRight,
  289. LPVARIANT pvarResult)
  290. {
  291. // I bet people don't check the return value
  292. // so do a VariantClear just to be safe
  293. ZeroMemory(pvarResult, sizeof(*pvarResult));
  294. return HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND);
  295. }
  296. static
  297. STDMETHODIMP
  298. VarPow(
  299. LPVARIANT pvarLeft,
  300. LPVARIANT pvarRight,
  301. LPVARIANT pvarResult)
  302. {
  303. // I bet people don't check the return value
  304. // so do a VariantClear just to be safe
  305. ZeroMemory(pvarResult, sizeof(*pvarResult));
  306. return HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND);
  307. }
  308. static
  309. STDMETHODIMP
  310. RegisterTypeLib(
  311. ITypeLib * ptlib,
  312. OLECHAR *szFullPath,
  313. OLECHAR *szHelpDir
  314. )
  315. {
  316. return HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND);
  317. }
  318. static
  319. STDMETHODIMP
  320. LoadTypeLib(
  321. const OLECHAR *szFile,
  322. ITypeLib ** pptlib
  323. )
  324. {
  325. return HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND);
  326. }
  327. static
  328. STDMETHODIMP_(BSTR)
  329. SysAllocStringLen(
  330. const OLECHAR * strIn,
  331. UINT cch
  332. )
  333. {
  334. return NULL;
  335. }
  336. static
  337. STDMETHODIMP
  338. VariantChangeType(
  339. VARIANTARG * pvargDest,
  340. VARIANTARG * pvarSrc,
  341. USHORT wFlags,
  342. VARTYPE vt
  343. )
  344. {
  345. return HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND);
  346. }
  347. static
  348. STDMETHODIMP
  349. SafeArrayGetLBound(
  350. SAFEARRAY * psa,
  351. UINT nDim,
  352. LONG * plLbound
  353. )
  354. {
  355. return HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND);
  356. }
  357. static
  358. WINOLEAUTAPI
  359. DispInvoke(
  360. void * _this,
  361. ITypeInfo * ptinfo,
  362. DISPID dispidMember,
  363. WORD wFlags,
  364. DISPPARAMS * pparams,
  365. VARIANT * pvarResult,
  366. EXCEPINFO * pexcepinfo,
  367. UINT * puArgErr
  368. )
  369. {
  370. return E_OUTOFMEMORY;
  371. }
  372. static
  373. WINOLEAUTAPI
  374. DispGetIDsOfNames(
  375. ITypeInfo * ptinfo,
  376. OLECHAR ** rgszNames,
  377. UINT cNames,
  378. DISPID * rgdispid
  379. )
  380. {
  381. return E_OUTOFMEMORY;
  382. }
  383. static
  384. WINOLEAUTAPI
  385. SafeArrayGetElement(
  386. SAFEARRAY* psa,
  387. LONG* rgIndices,
  388. void* pv
  389. )
  390. {
  391. return E_OUTOFMEMORY;
  392. }
  393. static
  394. WINOLECTLAPI
  395. OleCreatePropertyFrameIndirect(
  396. LPOCPFIPARAMS lpParams
  397. )
  398. {
  399. return HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND);
  400. }
  401. static
  402. WINOLEAUTAPI
  403. VariantCopyInd(
  404. VARIANT* pvarDest,
  405. VARIANTARG* pvargSrc
  406. )
  407. {
  408. return E_OUTOFMEMORY;
  409. }
  410. static
  411. WINOLEAUTAPI_(UINT)
  412. SafeArrayGetElemsize(
  413. SAFEARRAY * psa
  414. )
  415. {
  416. return 0;
  417. }
  418. //
  419. // !! WARNING !! The entries below must be in order by ORDINAL
  420. //
  421. DEFINE_ORDINAL_ENTRIES(oleaut32)
  422. {
  423. DLOENTRY( 2, SysAllocString)
  424. DLOENTRY( 4, SysAllocStringLen)
  425. DLOENTRY( 6, SysFreeString)
  426. DLOENTRY( 7, SysStringLen)
  427. DLOENTRY( 8, VariantInit)
  428. DLOENTRY( 9, VariantClear)
  429. DLOENTRY( 10, VariantCopy)
  430. DLOENTRY( 11, VariantCopyInd)
  431. DLOENTRY( 12, VariantChangeType)
  432. DLOENTRY( 13, VariantTimeToDosDateTime)
  433. DLOENTRY( 14, DosDateTimeToVariantTime)
  434. DLOENTRY( 15, SafeArrayCreate)
  435. DLOENTRY( 16, SafeArrayDestroy)
  436. DLOENTRY( 17, SafeArrayGetDim)
  437. DLOENTRY( 18, SafeArrayGetElemsize)
  438. DLOENTRY( 19, SafeArrayGetUBound)
  439. DLOENTRY( 20, SafeArrayGetLBound)
  440. DLOENTRY( 23, SafeArrayAccessData)
  441. DLOENTRY( 24, SafeArrayUnaccessData)
  442. DLOENTRY( 25, SafeArrayGetElement)
  443. DLOENTRY( 26, SafeArrayPutElement)
  444. DLOENTRY( 27, SafeArrayCopy)
  445. DLOENTRY( 29, DispGetIDsOfNames)
  446. DLOENTRY( 30, DispInvoke)
  447. DLOENTRY(143, VarDiv)
  448. DLOENTRY(149, SysStringByteLen)
  449. DLOENTRY(150, SysAllocStringByteLen)
  450. DLOENTRY(156, VarMul)
  451. DLOENTRY(158, VarPow)
  452. DLOENTRY(161, LoadTypeLib)
  453. DLOENTRY(162, LoadRegTypeLib)
  454. DLOENTRY(163, RegisterTypeLib)
  455. DLOENTRY(173, VarNeg)
  456. DLOENTRY(175, VarRound)
  457. DLOENTRY(176, VarCmp)
  458. DLOENTRY(184, SystemTimeToVariantTime)
  459. DLOENTRY(185, VariantTimeToSystemTime)
  460. DLOENTRY(201, SetErrorInfo)
  461. DLOENTRY(411, SafeArrayCreateVector)
  462. DLOENTRY(416, OleCreatePropertyFrameIndirect)
  463. DLOENTRY(417, OleCreatePropertyFrame)
  464. };
  465. DEFINE_ORDINAL_MAP(oleaut32);