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.

94 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. #define ARRAYSIZE(a) (sizeof(a)/sizeof((a)[0]))
  25. // The dwType field of a REGENTRY is set to this if the string is a resource
  26. #define REG_RESID ( REG_RESOURCE_REQUIREMENTS_LIST + 1 )
  27. #define KEYTYPE_STRING 1
  28. #define KEYTYPE_RESID 2
  29. // SELF REGISTRATION RELATED DECLARATIONS
  30. // Note: this struct used to have 'char' fields, but this caused
  31. // PMac Hlink dll to crash, so now the fields are 32 bit aligned.
  32. typedef struct {
  33. DWORD iKeyType; // pszKey contains localizable parts if this
  34. // is set to KEYTYPE_RESID
  35. char *pszKey;
  36. char *pszValueName;
  37. DWORD dwType;
  38. BYTE *pbData; // If dwType is REG_RESID, this is a resource ID
  39. } REGENTRY;
  40. typedef struct {
  41. HKEY hkRoot;
  42. const REGENTRY *rgEntries;
  43. DWORD dwEntries;
  44. } REGENTRYGROUP;
  45. // Function
  46. typedef BOOL (__stdcall * PFNLOADSTRING)(HINSTANCE hinst, int ids, char* sz, int cch);
  47. // Helper for DllRegisterServer
  48. HRESULT HrDllRegisterServer(
  49. const REGENTRYGROUP *rgRegEntryGroups,
  50. HINSTANCE hinstDll,
  51. PFNLOADSTRING pfnLoadString, char *pszAppName = NULL);
  52. // Helper for DllUnregisterServer
  53. HRESULT HrDllUnregisterServer(
  54. const REGENTRYGROUP *rgRegEntryGroups,
  55. HINSTANCE hinstDll,
  56. PFNLOADSTRING pfnLoadString);
  57. // Register a group of reg entries off a root key
  58. BOOL FRegisterEntries(HKEY hkRoot, const REGENTRY rgEntries[],
  59. DWORD dwEntries, char *pszPath, char *pszBinderName);
  60. // Register several groups of reg entries
  61. BOOL FRegisterEntryGroups(const REGENTRYGROUP *rgRegEntryGroups,
  62. char *pszPath, char *pszBinderName);
  63. // FDeleteEntries - Delete a group of reg entries off a root key.
  64. BOOL FDeleteEntries(HKEY hkRoot, const REGENTRY rgEntries[], DWORD dwEntries);
  65. // FDeleteEntryGroups - Delete the base keys of all the given groups.
  66. BOOL FDeleteEntryGroups(const REGENTRYGROUP *rgRegEntryGroups);
  67. // Given the potential full path szFileName, return the filename portion
  68. LPSTR ParseAFileName( LPSTR szFileName, int *piRetLen);
  69. #define STD_ENTRY(pszKey, pszValue) \
  70. { KEYTYPE_STRING, pszKey, NULL, REG_SZ, (BYTE*)pszValue }
  71. #define STD_RES_ENTRY(pszKey, wResId) \
  72. {KEYTYPE_STRING, pszKey, NULL, REG_RESID, (BYTE*)wResId }
  73. #define STD_INTERFACE_ENTRY(Name, Clsid, Dll) \
  74. STD_ENTRY("Interface\\" Clsid, Name), \
  75. STD_ENTRY("Interface\\" Clsid "\\ProxyStubClsid" NotMac("32"), Dll)
  76. #endif // _SELFREG_HXX_DEFINED_
  77.