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.

148 lines
2.5 KiB

  1. //
  2. // Copyright 1997 - Microsoft
  3. //
  4. //
  5. // UTILS.H - Common non-class specific utility calls.
  6. //
  7. #ifndef _UTILS_H_
  8. #define _UTILS_H_
  9. #include "cenumsif.h"
  10. ///////////////////////////////////////
  11. //
  12. // globals
  13. //
  14. // GUID text size
  15. #define PRETTY_GUID_STRING_BUFFER_SIZE sizeof(L"{AC409538-741C-11d1-BBE6-0060081692B3}")
  16. #define MAX_INPUT_GUID_STRING 56 // abitrary; allows for spaces in pasted GUIDs
  17. ///////////////////////////////////////
  18. //
  19. // structs, enums
  20. //
  21. typedef struct {
  22. LPWSTR pszFilePath;
  23. LPWSTR pszDescription;
  24. LPWSTR pszDirectory;
  25. LPWSTR pszHelpText;
  26. LPWSTR pszVersion;
  27. LPWSTR pszLanguage;
  28. LPWSTR pszArchitecture;
  29. LPWSTR pszImageType;
  30. LPWSTR pszImageFile;
  31. FILETIME ftLastWrite;
  32. } SIFINFO, *LPSIFINFO;
  33. ///////////////////////////////////////
  34. //
  35. // functions
  36. //
  37. HRESULT
  38. AddPagesEx(
  39. ITab ** pTab,
  40. LPCREATEINST pfnCreateInstance,
  41. LPFNADDPROPSHEETPAGE lpfnAddPage,
  42. LPARAM lParam,
  43. LPUNKNOWN );
  44. HRESULT
  45. CheckClipboardFormats( );
  46. HRESULT
  47. DNtoFQDN(
  48. LPWSTR pszDN,
  49. LPWSTR * pszFQDN );
  50. HRESULT
  51. DNtoFQDNEx(
  52. LPWSTR pszDN,
  53. LPWSTR * pszFQDN );
  54. HRESULT
  55. GetDomainDN(
  56. LPWSTR pszDN,
  57. LPWSTR * pszDomainDn);
  58. HRESULT
  59. PopulateListView(
  60. HWND hwndList,
  61. IEnumIMSIFs * penum );
  62. HRESULT
  63. FixObjectPath(
  64. LPWSTR Object,
  65. LPWSTR pszOldObjectPath,
  66. LPWSTR *ppszNewObjectPath );
  67. int
  68. MessageBoxFromStrings(
  69. HWND hParent,
  70. UINT idsCaption,
  71. UINT idsText,
  72. UINT uType );
  73. void
  74. MessageBoxFromError(
  75. HWND hParent,
  76. UINT idsCaption,
  77. DWORD dwErr );
  78. void
  79. MessageBoxFromHResult(
  80. HWND hParent,
  81. UINT idsCaption,
  82. HRESULT hr );
  83. BOOL
  84. VerifySIFText(
  85. LPWSTR pszText );
  86. #ifndef ADSI_DNS_SEARCH
  87. #include <winldap.h>
  88. DWORD
  89. Ldap_InitializeConnection(
  90. PLDAP * LdapHandle );
  91. #endif // ADSI_DNS_SEARCH
  92. HRESULT
  93. ValidateGuid(
  94. IN LPWSTR pszGuid,
  95. OUT LPGUID Guid OPTIONAL,
  96. OUT LPDWORD uGuidLength OPTIONAL );
  97. LPWSTR
  98. PrettyPrintGuid(
  99. IN LPGUID uGuid
  100. );
  101. HRESULT
  102. CheckForDuplicateGuid(
  103. IN LPGUID uGuid );
  104. void
  105. AddWizardPage(
  106. LPPROPSHEETHEADER ppsh,
  107. UINT id,
  108. DLGPROC pfn,
  109. UINT idTitle,
  110. UINT idSubtitle,
  111. LPARAM lParam );
  112. class CWaitCursor
  113. {
  114. private:
  115. HCURSOR _hOldCursor;
  116. public:
  117. CWaitCursor( ) { _hOldCursor = SetCursor( LoadCursor( NULL, IDC_WAIT ) ); };
  118. ~CWaitCursor( ) { SetCursor( _hOldCursor ); };
  119. };
  120. #endif // _UTILS_H_