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.

305 lines
12 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1999
  6. //
  7. // File: dxglob7obj.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #include "resource.h" // main symbols
  11. typedef HRESULT (__stdcall *DDRAWCREATE)( GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter );
  12. typedef HRESULT (__stdcall *DDCREATECLIPPER)( DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter );
  13. typedef HRESULT (__stdcall *DDENUMERATE)(LPDDENUMCALLBACK, LPVOID);
  14. typedef HRESULT (__stdcall *DDENUMERATEEX)(LPDDENUMCALLBACKEX, LPVOID, DWORD);
  15. typedef HRESULT (__stdcall *DIRECT3DRMCREATE)(LPDIRECT3DRM *lpCreate);
  16. typedef HRESULT (__stdcall *DSOUNDCREATE)(GUID FAR * lpGUID, LPDIRECTSOUND * ppDS, IUnknown FAR *pUnkOuter );
  17. typedef HRESULT (__stdcall *DSOUNDCAPTURECREATE)(GUID FAR * lpGUID, LPDIRECTSOUNDCAPTURE * ppDS, IUnknown FAR *pUnkOuter );
  18. typedef HRESULT (CALLBACK *DSOUNDENUMERATE)(LPDSENUMCALLBACK lpCallback, LPVOID lpContext );
  19. typedef HRESULT (CALLBACK *DSOUNDCAPTUREENUMERATE)(LPDSENUMCALLBACK lpCallback, LPVOID lpContext );
  20. typedef HRESULT (__stdcall *DIRECTPLAYCREATE)( LPGUID lpGUID, LPDIRECTPLAY *lplpDP, IUnknown *pUnk);
  21. typedef HRESULT (__stdcall *DIRECTPLAYENUMERATE)( LPDPENUMDPCALLBACK, LPVOID );
  22. typedef HRESULT (__stdcall *DIRECTPLAYLOBBYCREATE)(LPGUID, LPDIRECTPLAYLOBBY *, IUnknown *, LPVOID, DWORD );
  23. typedef HRESULT (__stdcall *DDRAWCREATEEX)( GUID FAR * rGuid, LPVOID *lplpDD, REFIID iid,IUnknown FAR *pUnkOuter );
  24. typedef struct tag_EVENTTHREADINFO {
  25. HANDLE hEvent;
  26. struct tag_EVENTTHREADINFO *pNext;
  27. IStream *pStream;
  28. I_dxj_DirectXEvent *pCallback;
  29. DWORD threadID;
  30. HANDLE hThread;
  31. BOOL fEnd;
  32. HANDLE hEndEvent;
  33. } EVENTTHREADINFO;
  34. class C_dxj_DirectX7Object :
  35. public I_dxj_DirectX7,
  36. public CComCoClass<C_dxj_DirectX7Object, &CLSID__dxj_DirectX7>, public CComObjectRoot
  37. {
  38. public:
  39. C_dxj_DirectX7Object() ;
  40. virtual ~C_dxj_DirectX7Object() ;
  41. BEGIN_COM_MAP(C_dxj_DirectX7Object)
  42. COM_INTERFACE_ENTRY(I_dxj_DirectX7)
  43. END_COM_MAP()
  44. DECLARE_REGISTRY(CLSID__dxj_DirectX7, "DIRECT.DirectX6.0", "DIRECT.DirectX6.0", IDS_DIRECTX6_DESC, THREADFLAGS_BOTH)
  45. // Use DECLARE_NOT_AGGREGATABLE(C_dxj_DirectSoundResourceObject) if you don't want your object
  46. // to support aggregation
  47. DECLARE_AGGREGATABLE(C_dxj_DirectX7Object)
  48. public:
  49. HRESULT STDMETHODCALLTYPE direct3dRMCreate(
  50. /* [retval][out] */ I_dxj_Direct3dRM3 __RPC_FAR *__RPC_FAR *ret);
  51. HRESULT STDMETHODCALLTYPE directDrawCreate(
  52. /* [in] */ BSTR guid,
  53. /* [retval][out] */ I_dxj_DirectDraw7 __RPC_FAR *__RPC_FAR *ret);
  54. HRESULT STDMETHODCALLTYPE getDDEnum(
  55. /* [retval][out] */ I_dxj_DirectDrawEnum __RPC_FAR *__RPC_FAR *ret);
  56. HRESULT STDMETHODCALLTYPE directSoundCreate(
  57. /* [in] */ BSTR guid,
  58. /* [retval][out] */ I_dxj_DirectSound __RPC_FAR *__RPC_FAR *ret);
  59. HRESULT STDMETHODCALLTYPE directSoundCaptureCreate(
  60. /* [in] */ BSTR guid,
  61. /* [retval][out] */ I_dxj_DirectSoundCapture __RPC_FAR *__RPC_FAR *ret);
  62. HRESULT STDMETHODCALLTYPE getDSEnum(
  63. /* [retval][out] */ I_dxj_DSEnum __RPC_FAR *__RPC_FAR *retVal);
  64. HRESULT STDMETHODCALLTYPE getDSCaptureEnum(
  65. /* [retval][out] */ I_dxj_DSEnum __RPC_FAR *__RPC_FAR *retVal);
  66. HRESULT STDMETHODCALLTYPE directInputCreate(
  67. /* [retval][out] */ I_dxj_DirectInput __RPC_FAR *__RPC_FAR *ret);
  68. HRESULT STDMETHODCALLTYPE directPlayCreate(
  69. /* [in] */ BSTR guid,
  70. /* [retval][out] */ I_dxj_DirectPlay4 __RPC_FAR *__RPC_FAR *ret);
  71. HRESULT STDMETHODCALLTYPE directPlayLobbyCreate(
  72. /* [retval][out] */ I_dxj_DirectPlayLobby3 __RPC_FAR *__RPC_FAR *ret);
  73. HRESULT STDMETHODCALLTYPE getDPEnum(
  74. /* [retval][out] */ I_dxj_DPEnumServiceProviders __RPC_FAR *__RPC_FAR *retval);
  75. HRESULT STDMETHODCALLTYPE colorGetAlpha(
  76. /* [in] */ long color,
  77. /* [retval][out] */ float __RPC_FAR *ret);
  78. HRESULT STDMETHODCALLTYPE colorGetBlue(
  79. /* [in] */ long color,
  80. /* [retval][out] */ float __RPC_FAR *ret);
  81. HRESULT STDMETHODCALLTYPE colorGetGreen(
  82. /* [in] */ long color,
  83. /* [retval][out] */ float __RPC_FAR *ret);
  84. HRESULT STDMETHODCALLTYPE colorGetRed(
  85. /* [in] */ long color,
  86. /* [retval][out] */ float __RPC_FAR *ret);
  87. HRESULT STDMETHODCALLTYPE createColorRGB(
  88. /* [in] */ float r,
  89. /* [in] */ float g,
  90. /* [in] */ float b,
  91. /* [retval][out] */ long __RPC_FAR *color);
  92. HRESULT STDMETHODCALLTYPE createColorRGBA(
  93. /* [in] */ float r,
  94. /* [in] */ float g,
  95. /* [in] */ float b,
  96. /* [in] */ float a,
  97. /* [retval][out] */ long __RPC_FAR *color);
  98. HRESULT STDMETHODCALLTYPE matrixFromQuaternion(
  99. /* [out] */ D3dMatrix __RPC_FAR *matrix,
  100. /* [in] */ D3dRMQuaternion __RPC_FAR *quat);
  101. HRESULT STDMETHODCALLTYPE quaternionRotation(
  102. /* [out] */ D3dRMQuaternion __RPC_FAR *quat,
  103. /* [in] */ D3dVector __RPC_FAR *axis,
  104. /* [in] */ float theta);
  105. HRESULT STDMETHODCALLTYPE quaternionMultiply(
  106. /* [out] */ D3dRMQuaternion __RPC_FAR *quat,
  107. /* [in] */ D3dRMQuaternion __RPC_FAR *quatA,
  108. /* [in] */ D3dRMQuaternion __RPC_FAR *quatB);
  109. HRESULT STDMETHODCALLTYPE quaternionSlerp(
  110. /* [out] */ D3dRMQuaternion __RPC_FAR *quat,
  111. /* [in] */ D3dRMQuaternion __RPC_FAR *quatA,
  112. /* [in] */ D3dRMQuaternion __RPC_FAR *quatB,
  113. /* [in] */ float alpha);
  114. HRESULT STDMETHODCALLTYPE vectorAdd(
  115. /* [out] */ D3dVector __RPC_FAR *v,
  116. /* [in] */ D3dVector __RPC_FAR *vA,
  117. /* [in] */ D3dVector __RPC_FAR *vB);
  118. HRESULT STDMETHODCALLTYPE vectorCrossProduct(
  119. /* [out] */ D3dVector __RPC_FAR *v,
  120. /* [in] */ D3dVector __RPC_FAR *vA,
  121. /* [in] */ D3dVector __RPC_FAR *vB);
  122. HRESULT STDMETHODCALLTYPE vectorDotProduct(
  123. /* [in] */ D3dVector __RPC_FAR *vA,
  124. /* [in] */ D3dVector __RPC_FAR *vB,
  125. /* [retval][out] */ float __RPC_FAR *ret);
  126. HRESULT STDMETHODCALLTYPE vectorModulus(
  127. /* [in] */ D3dVector __RPC_FAR *vA,
  128. /* [retval][out] */ float __RPC_FAR *ret);
  129. HRESULT STDMETHODCALLTYPE vectorNormalize(
  130. /* [out][in] */ D3dVector __RPC_FAR *v);
  131. HRESULT STDMETHODCALLTYPE vectorRandom(
  132. /* [out][in] */ D3dVector __RPC_FAR *v);
  133. HRESULT STDMETHODCALLTYPE vectorReflect(
  134. /* [out] */ D3dVector __RPC_FAR *vDest,
  135. /* [in] */ D3dVector __RPC_FAR *vRay,
  136. /* [in] */ D3dVector __RPC_FAR *vNormal);
  137. HRESULT STDMETHODCALLTYPE vectorRotate(
  138. /* [out] */ D3dVector __RPC_FAR *vDest,
  139. /* [in] */ D3dVector __RPC_FAR *vA,
  140. /* [in] */ D3dVector __RPC_FAR *vAxis,
  141. /* [in] */ float theta);
  142. HRESULT STDMETHODCALLTYPE vectorScale(
  143. /* [out] */ D3dVector __RPC_FAR *vDest,
  144. /* [in] */ D3dVector __RPC_FAR *vA,
  145. /* [in] */ float factor);
  146. HRESULT STDMETHODCALLTYPE vectorSubtract(
  147. /* [out] */ D3dVector __RPC_FAR *v,
  148. /* [in] */ D3dVector __RPC_FAR *vA,
  149. /* [in] */ D3dVector __RPC_FAR *vB);
  150. HRESULT STDMETHODCALLTYPE vectorCopy(
  151. /* [out][in] */ D3dVector __RPC_FAR *vDest,
  152. /* [in] */ D3dVector __RPC_FAR *vSrc);
  153. HRESULT STDMETHODCALLTYPE rotateXMatrix(
  154. /* [out][in] */ D3dMatrix __RPC_FAR *mDest,
  155. /* [in] */ float radians);
  156. HRESULT STDMETHODCALLTYPE rotateYMatrix(
  157. /* [out][in] */ D3dMatrix __RPC_FAR *mDest,
  158. /* [in] */ float radians);
  159. HRESULT STDMETHODCALLTYPE rotateZMatrix(
  160. /* [out][in] */ D3dMatrix __RPC_FAR *mDest,
  161. /* [in] */ float radians);
  162. HRESULT STDMETHODCALLTYPE viewMatrix(
  163. /* [out][in] */ D3dMatrix __RPC_FAR *mDest,
  164. /* [in] */ D3dVector __RPC_FAR *vFrom,
  165. /* [in] */ D3dVector __RPC_FAR *vTo,
  166. /* [in] */ D3dVector __RPC_FAR *vUp,
  167. /* [in] */ float roll);
  168. HRESULT STDMETHODCALLTYPE matrixMultiply(
  169. /* [out][in] */ D3dMatrix __RPC_FAR *mDest,
  170. /* [in] */ D3dMatrix __RPC_FAR *mA,
  171. /* [in] */ D3dMatrix __RPC_FAR *mB);
  172. HRESULT STDMETHODCALLTYPE projectionMatrix(
  173. /* [out][in] */ D3dMatrix __RPC_FAR *mDest,
  174. /* [in] */ float nearPlane,
  175. /* [in] */ float farplane,
  176. /* [in] */ float fov);
  177. HRESULT STDMETHODCALLTYPE copyMatrix(
  178. /* [out][in] */ D3dMatrix __RPC_FAR *mDest,
  179. /* [in] */ D3dMatrix __RPC_FAR *mSrc);
  180. HRESULT STDMETHODCALLTYPE identityMatrix(
  181. /* [out][in] */ D3dMatrix __RPC_FAR *mDest);
  182. HRESULT STDMETHODCALLTYPE zeroMatrix(
  183. /* [out][in] */ D3dMatrix __RPC_FAR *mDest);
  184. HRESULT STDMETHODCALLTYPE tickCount(
  185. /* [retval][out] */ long __RPC_FAR *retv);
  186. HRESULT STDMETHODCALLTYPE systemBpp(
  187. /* [retval][out] */ long __RPC_FAR *retv);
  188. HRESULT STDMETHODCALLTYPE directMusicLoaderCreate(
  189. /* [retval][out] */ I_dxj_DirectMusicLoader __RPC_FAR *__RPC_FAR *ret);
  190. HRESULT STDMETHODCALLTYPE directMusicComposerCreate(
  191. /* [retval][out] */ I_dxj_DirectMusicComposer __RPC_FAR *__RPC_FAR *ret);
  192. HRESULT STDMETHODCALLTYPE directMusicPerformanceCreate(
  193. /* [retval][out] */ I_dxj_DirectMusicPerformance __RPC_FAR *__RPC_FAR *ret);
  194. HRESULT STDMETHODCALLTYPE getWindowRect(
  195. /* [in] */ long hwnd,
  196. /* [out][in] */ Rect __RPC_FAR *r) ;
  197. HRESULT STDMETHODCALLTYPE createEvent(
  198. /* [in] */ I_dxj_DirectXEvent __RPC_FAR *event,
  199. /* [retval][out] */ long __RPC_FAR *h) ;
  200. HRESULT STDMETHODCALLTYPE setEvent(
  201. /* [in] */ long eventId) ;
  202. HRESULT STDMETHODCALLTYPE destroyEvent(
  203. /* [in] */ long eventId) ;
  204. HRESULT STDMETHODCALLTYPE createD3DVertex(float x, float y, float z, float nx, float ny, float nz, float tu, float tv, D3dVertex *v);
  205. HRESULT STDMETHODCALLTYPE createD3DLVertex(float x, float y, float z, long color, long specular, float tu, float tv, D3dLVertex *v);
  206. HRESULT STDMETHODCALLTYPE createD3DTLVertex(float sx, float sy, float sz, float rhw, long color, long specular, float tu, float tv, D3dTLVertex *v);
  207. HRESULT STDMETHODCALLTYPE directDraw4Create(
  208. /* [in] */ BSTR guid,
  209. /* [retval][out] */ I_dxj_DirectDraw4 __RPC_FAR *__RPC_FAR *ret);
  210. HRESULT STDMETHODCALLTYPE createNewGuid(BSTR *ret);
  211. void LoadDDRAW();
  212. void LoadDPLAY();
  213. void LoadDSOUND();
  214. void LoadDINPUT();
  215. void LoadD3DRM();
  216. private:
  217. DDRAWCREATE m_pDirectDrawCreate;
  218. DDRAWCREATEEX m_pDirectDrawCreateEx;
  219. DDCREATECLIPPER m_pDirectDrawCreateClipper;
  220. DSOUNDCREATE m_pDirectSoundCreate;
  221. DSOUNDCAPTURECREATE m_pDirectSoundCaptureCreate;
  222. DSOUNDENUMERATE m_pDirectSoundEnumerate;
  223. DSOUNDCAPTUREENUMERATE m_pDirectSoundCaptureEnumerate;
  224. DIRECTPLAYCREATE m_pDirectPlayCreate;
  225. DIRECTPLAYENUMERATE m_pDirectPlayEnumerate;
  226. DIRECTPLAYLOBBYCREATE m_pDirectPlayLobbyCreate;
  227. DIRECT3DRMCREATE m_pDirect3DRMCreate;
  228. DDENUMERATE m_pDirectDrawEnumerate;
  229. DDENUMERATEEX m_pDirectDrawEnumerateEx;
  230. EVENTTHREADINFO *m_pEventList;
  231. };