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.

96 lines
3.3 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. // File: selfreg.hxx
  7. //
  8. // Contents: Taken from Office96
  9. // Header file for the common self registration code used by all the
  10. // sub projects of Sweeper project. They are
  11. // UrlMon
  12. // UrlMnPrx
  13. //
  14. // Classes:
  15. //
  16. // Functions:
  17. //
  18. // History: 5-03-96 JohannP (Johann Posch) Created
  19. //
  20. //----------------------------------------------------------------------------
  21. #ifndef _SELFREG_HXX_DEFINED_
  22. #define _SELFREG_HXX_DEFINED_
  23. // Computes the number of elements in an array
  24. #ifndef ARRAYSIZE
  25. #define ARRAYSIZE(a) (sizeof(a)/sizeof((a)[0]))
  26. #endif
  27. // The dwType field of a REGENTRY is set to this if the string is a resource
  28. #define REG_RESID ( REG_RESOURCE_REQUIREMENTS_LIST + 1 )
  29. #define KEYTYPE_STRING 1
  30. #define KEYTYPE_RESID 2
  31. // SELF REGISTRATION RELATED DECLARATIONS
  32. // Note: this struct used to have 'char' fields, but this caused
  33. // PMac Hlink dll to crash, so now the fields are 32 bit aligned.
  34. typedef struct {
  35. DWORD iKeyType; // pszKey contains localizable parts if this
  36. // is set to KEYTYPE_RESID
  37. char *pszKey;
  38. char *pszValueName;
  39. DWORD dwType;
  40. BYTE *pbData; // If dwType is REG_RESID, this is a resource ID
  41. } REGENTRY;
  42. typedef struct {
  43. HKEY hkRoot;
  44. const REGENTRY *rgEntries;
  45. DWORD dwEntries;
  46. } REGENTRYGROUP;
  47. // Function
  48. typedef BOOL (__stdcall * PFNLOADSTRING)(HINSTANCE hinst, int ids, char* sz, int cch);
  49. // Helper for DllRegisterServer
  50. HRESULT HrDllRegisterServer(
  51. const REGENTRYGROUP *rgRegEntryGroups,
  52. HINSTANCE hinstDll,
  53. PFNLOADSTRING pfnLoadString, char *pszAppName = NULL);
  54. // Helper for DllUnregisterServer
  55. HRESULT HrDllUnregisterServer(
  56. const REGENTRYGROUP *rgRegEntryGroups,
  57. HINSTANCE hinstDll,
  58. PFNLOADSTRING pfnLoadString);
  59. // Register a group of reg entries off a root key
  60. BOOL FRegisterEntries(HKEY hkRoot, const REGENTRY rgEntries[],
  61. DWORD dwEntries, char *pszPath, char *pszBinderName);
  62. // Register several groups of reg entries
  63. BOOL FRegisterEntryGroups(const REGENTRYGROUP *rgRegEntryGroups,
  64. char *pszPath, char *pszBinderName);
  65. // FDeleteEntries - Delete a group of reg entries off a root key.
  66. BOOL FDeleteEntries(HKEY hkRoot, const REGENTRY rgEntries[], DWORD dwEntries);
  67. // FDeleteEntryGroups - Delete the base keys of all the given groups.
  68. BOOL FDeleteEntryGroups(const REGENTRYGROUP *rgRegEntryGroups);
  69. // Given the potential full path szFileName, return the filename portion
  70. LPSTR ParseAFileName( LPSTR szFileName, int *piRetLen);
  71. #define STD_ENTRY(pszKey, pszValue) \
  72. { KEYTYPE_STRING, pszKey, NULL, REG_SZ, (BYTE*)pszValue }
  73. #define STD_RES_ENTRY(pszKey, wResId) \
  74. {KEYTYPE_STRING, pszKey, NULL, REG_RESID, (BYTE*)wResId }
  75. #define STD_INTERFACE_ENTRY(Name, Clsid, Dll) \
  76. STD_ENTRY("Interface\\" Clsid, Name), \
  77. STD_ENTRY("Interface\\" Clsid "\\ProxyStubClsid" NotMac("32"), Dll)
  78. #endif // _SELFREG_HXX_DEFINED_