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.

72 lines
2.0 KiB

  1. #ifndef _FACTDATA_H_
  2. #define _FACTDATA_H_
  3. #include <objbase.h>
  4. ///////////////////////////////////////////////////////////////////////////////
  5. // Component creation function
  6. typedef void (*COMFACTORYCB)(BOOL fIncrement);
  7. typedef HRESULT (*FPCREATEINSTANCE)(COMFACTORYCB, IUnknown*, IUnknown**);
  8. #define THREADINGMODEL_FREE 0x00000001
  9. #define THREADINGMODEL_APARTMENT 0x00000002
  10. #define THREADINGMODEL_NEUTRAL 0x00000004
  11. #define THREADINGMODEL_BOTH (THREADINGMODEL_FREE | THREADINGMODEL_APARTMENT)
  12. extern const CLSID APPID_ShellHWDetection;
  13. ///////////////////////////////////////////////////////////////////////////////
  14. // CFactoryData
  15. // Information CFactory needs to create a component supported by the DLL
  16. class CFactoryData
  17. {
  18. public:
  19. // The class ID for the component
  20. const CLSID* _pCLSID;
  21. // Pointer to the function that creates it
  22. FPCREATEINSTANCE CreateInstance;
  23. // Name of the component to register in the registry
  24. LPCWSTR _pszRegistryName;
  25. // ProgID
  26. LPCWSTR _pszProgID;
  27. // Version-independent ProgID
  28. LPCWSTR _pszVerIndProgID;
  29. // ThreadingModel
  30. DWORD _dwThreadingModel;
  31. // For CoRegisterClassObject (used only for COM Exe server)
  32. DWORD _dwClsContext;
  33. // For CoRegisterClassObject (used only for COM Exe server)
  34. DWORD _dwFlags;
  35. // LocalService
  36. LPCWSTR _pszLocalService;
  37. // AppID
  38. const CLSID* _pAppID;
  39. // Helper function for finding the class ID
  40. BOOL IsClassID(REFCLSID rclsid) const
  41. { return (*_pCLSID == rclsid);}
  42. //
  43. BOOL IsInprocServer() const
  44. { return !_dwClsContext || ((CLSCTX_INPROC_SERVER |
  45. CLSCTX_INPROC_HANDLER) & _dwClsContext); }
  46. BOOL IsLocalServer() const
  47. { return ((CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER) & _dwClsContext) && !_pszLocalService; }
  48. BOOL IsLocalService() const
  49. { return ((CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER) & _dwClsContext) &&
  50. _pszLocalService; }
  51. };
  52. #endif //_FACTDATA_H_