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.

148 lines
2.4 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. extern WCHAR g_wszLDAPPrefix[];
  15. extern const LONG SIZEOF_g_wszLDAPPrefix;
  16. // GUID text size
  17. #define PRETTY_GUID_STRING_BUFFER_SIZE sizeof(L"{AC409538-741C-11d1-BBE6-0060081692B3}")
  18. #define MAX_INPUT_GUID_STRING 56 // abitrary; allows for spaces in pasted GUIDs
  19. ///////////////////////////////////////
  20. //
  21. // structs, enums
  22. //
  23. typedef struct {
  24. LPWSTR pszFilePath;
  25. LPWSTR pszDescription;
  26. LPWSTR pszDirectory;
  27. LPWSTR pszHelpText;
  28. LPWSTR pszVersion;
  29. LPWSTR pszLanguage;
  30. LPWSTR pszArchitecture;
  31. LPWSTR pszImageType;
  32. LPWSTR pszImageFile;
  33. FILETIME ftLastWrite;
  34. } SIFINFO, *LPSIFINFO;
  35. ///////////////////////////////////////
  36. //
  37. // functions
  38. //
  39. HRESULT
  40. AddPagesEx(
  41. ITab ** pTab,
  42. LPCREATEINST pfnCreateInstance,
  43. LPFNADDPROPSHEETPAGE lpfnAddPage,
  44. LPARAM lParam,
  45. LPUNKNOWN );
  46. HRESULT
  47. CheckClipboardFormats( );
  48. HRESULT
  49. DNtoFQDN(
  50. LPWSTR pszDN,
  51. LPWSTR * pszFQDN );
  52. HRESULT
  53. PopulateListView(
  54. HWND hwndList,
  55. IEnumIMSIFs * penum );
  56. HRESULT
  57. LDAPPrefix(
  58. PWSTR pwzObjDN,
  59. PWSTR * ppwzObjLDAPPath);
  60. int
  61. MessageBoxFromStrings(
  62. HWND hParent,
  63. UINT idsCaption,
  64. UINT idsText,
  65. UINT uType );
  66. void
  67. MessageBoxFromError(
  68. HWND hParent,
  69. UINT idsCaption,
  70. DWORD dwErr );
  71. void
  72. MessageBoxFromHResult(
  73. HWND hParent,
  74. UINT idsCaption,
  75. HRESULT hr );
  76. BOOL
  77. VerifySIFText(
  78. LPWSTR pszText );
  79. #ifndef ADSI_DNS_SEARCH
  80. #include <winldap.h>
  81. DWORD
  82. Ldap_InitializeConnection(
  83. PLDAP * LdapHandle );
  84. #endif // ADSI_DNS_SEARCH
  85. HRESULT
  86. ValidateGuid(
  87. IN LPWSTR pszGuid,
  88. OUT LPBYTE uGuid OPTIONAL,
  89. OUT LPDWORD puGuidLength OPTIONAL );
  90. LPWSTR
  91. PrettyPrintGuid(
  92. IN LPBYTE uGuid );
  93. HRESULT
  94. CheckForDuplicateGuid(
  95. IN LPBYTE uGuid );
  96. void
  97. AddWizardPage(
  98. LPPROPSHEETHEADER ppsh,
  99. UINT id,
  100. DLGPROC pfn,
  101. UINT idTitle,
  102. UINT idSubtitle,
  103. LPARAM lParam );
  104. INT CALLBACK
  105. BrowseForRIServersCallback(
  106. HWND hwnd,
  107. UINT uMsg,
  108. LPARAM lParam,
  109. LPARAM lpData
  110. );
  111. class CWaitCursor
  112. {
  113. private:
  114. HCURSOR _hOldCursor;
  115. public:
  116. CWaitCursor( ) { _hOldCursor = SetCursor( LoadCursor( NULL, IDC_WAIT ) ); };
  117. ~CWaitCursor( ) { SetCursor( _hOldCursor ); };
  118. };
  119. #endif // _UTILS_H_