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.

114 lines
2.1 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. wx86grpa.h
  5. Abstract:
  6. Ole interface into Wx86
  7. Author:
  8. 29-Sep-1995 AlanWar
  9. Revision History:
  10. --*/
  11. #ifdef WX86OLE
  12. #include <wx86pri.h>
  13. class CWx86 {
  14. public:
  15. CWx86();
  16. ~CWx86();
  17. BOOL IsWx86Linked(void);
  18. BOOL ReferenceWx86(void);
  19. void DereferenceWx86(void);
  20. void UnloadWx86(void);
  21. BOOL LinkToWx86(void);
  22. void UnlinkFromWx86(void);
  23. HMODULE LoadX86Dll(LPCWSTR ptszPath);
  24. BOOL FreeX86Dll(HMODULE hmod);
  25. BOOL IsModuleX86(HMODULE hModule);
  26. PFNDLLGETCLASSOBJECT TranslateDllGetClassObject(PFNDLLGETCLASSOBJECT pv);
  27. PFNDLLCANUNLOADNOW TranslateDllCanUnloadNow(PFNDLLCANUNLOADNOW pv);
  28. void SetStubInvokeFlag(UCHAR bFlag);
  29. BOOL NeedX86PSFactory(IUnknown *punkObj, REFIID riid);
  30. BOOL IsN2XProxy(IUnknown *punk);
  31. PVOID UnmarshalledInSameApt(PVOID pv, REFIID piid);
  32. void AggregateProxy(IUnknown *, IUnknown *);
  33. BOOL IsQIFromX86(void);
  34. BOOL IsWx86Calling(void);
  35. BOOL SetIsWx86Calling(BOOL bFlag);
  36. private:
  37. PVOID *_apvWholeFuncs;
  38. HMODULE _hModuleWx86;
  39. RTL_CRITICAL_SECTION _critsect;
  40. LONG _lWx86UseCount;
  41. };
  42. inline BOOL CWx86::IsWx86Linked(void)
  43. /*++
  44. Routine Description:
  45. Determines if ole32 has dynamically linked to wx86 and whole32
  46. Arguments:
  47. Return Value:
  48. TRUE if Ole32 is dynamically linked to wx86
  49. --*/
  50. {
  51. return(_apvWholeFuncs != NULL);
  52. }
  53. inline void CWx86::UnlinkFromWx86(void)
  54. /*++
  55. Routine Description:
  56. Disestablish dynamic linkage between whole32 and ole32.
  57. Arguments:
  58. Return Value:
  59. --*/
  60. {
  61. _hModuleWx86 = NULL;
  62. _apvWholeFuncs = NULL;
  63. }
  64. //
  65. // Wrapper class for managing critical sections associated with other objects
  66. // The constructor will enter the critical section and the destructor will
  67. // exit the critical section. By declaring one on the stack you will ensure
  68. // that the destructor will run whenever it leaves scope.
  69. class CCritSect
  70. {
  71. public:
  72. CCritSect(RTL_CRITICAL_SECTION *pcritsect);
  73. ~CCritSect();
  74. private:
  75. RTL_CRITICAL_SECTION *_pcritsect;
  76. };
  77. #endif