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.

127 lines
3.8 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation
  3. Module Name:
  4. globals.h
  5. Abstract:
  6. header file for globals.cpp
  7. Author:
  8. William Hsieh (williamh) created
  9. Revision History:
  10. --*/
  11. #ifndef __GLOBALS_H_
  12. #define __GLOBALS_H_
  13. class CMachineList;
  14. class String;
  15. class CMemoryException;
  16. extern CMachineList g_MachineList;
  17. extern HINSTANCE g_hInstance;
  18. extern String g_strStartupMachineName;
  19. extern String g_strStartupDeviceId;
  20. extern String g_strStartupCommand;
  21. extern String g_strDevMgr;
  22. extern BOOL g_IsAdmin;
  23. extern CPrintDialog g_PrintDlg;
  24. extern CMemoryException g_MemoryException;
  25. extern const CLSID CLSID_DEVMGR;
  26. extern const CLSID CLSID_DEVMGR_EXTENSION;
  27. extern const CLSID CLSID_SYSTOOLS;
  28. extern const CLSID CLSID_DEVMGR_ABOUT;
  29. extern const IID IID_IDMTVOCX;
  30. extern const IID IID_ISnapinCallback;
  31. extern const TCHAR* const CLSID_STRING_DEVMGR;
  32. extern const TCHAR* const CLSID_STRING_DEVMGR_EXTENSION;
  33. extern const TCHAR* const CLSID_STRING_SYSTOOLS;
  34. extern const TCHAR* const CLSID_STRING_DEVMGR_ABOUT;
  35. extern const TCHAR* const MMC_SNAPIN_MACHINE_NAME;
  36. extern const TCHAR* const SNAPIN_INTERNAL;
  37. extern const TCHAR* const DEVMGR_SNAPIN_CLASS_GUID;
  38. extern const TCHAR* const DEVMGR_SNAPIN_DEVICE_ID;
  39. extern const TCHAR* const REG_PATH_DEVICE_MANAGER;
  40. extern const TCHAR* const REG_STR_BUS_TYPES;
  41. extern const TCHAR* const REG_STR_TROUBLESHOOTERS;
  42. extern const TCHAR* const DEVMGR_COMMAND_PROPERTY;
  43. extern const TCHAR* const DEVMGR_HELP_FILE_NAME;
  44. extern const TCHAR* const PROGID_DEVMGR;
  45. extern const TCHAR* const PROGID_DEVMGREXT;
  46. extern const TCHAR* const PROGID_DEVMGR_ABOUT;
  47. extern const TCHAR* const DEVMGR_HTML_HELP_FILE_NAME;
  48. const int MAX_PROP_PAGES = 64;
  49. #define DI_NEEDPOWERCYCLE 0x400000L
  50. // Sizes of various stringized numbers
  51. #define MAX_INT64_SIZE 30 // 2^64 is less than 30 chars long
  52. #define MAX_COMMA_NUMBER_SIZE (MAX_INT64_SIZE + 10)
  53. extern LPOLESTR AllocOleTaskString(LPCTSTR str);
  54. extern void FreeOleTaskString(LPOLESTR str);
  55. extern const NODEINFO NodeInfo[];
  56. //
  57. // global functions declaration
  58. //
  59. extern HRESULT AddMenuItem(LPCONTEXTMENUCALLBACK pCallback, int iNameStringId,
  60. int iStatusBarStringId, long lCommandId,
  61. long InsertionPointId, long Flags,
  62. long SpecialFlags = 0);
  63. extern BOOL VerifyMachineName(LPCTSTR MachineName);
  64. extern UINT LoadResourceString(int StringId, LPTSTR Buffer, UINT BufferSize);
  65. extern UINT GetDeviceProblemText(ULONG ProblemNumber, LPTSTR Buffer, UINT BufferSize);
  66. extern int MsgBoxParam(HWND hwnd, int MsgId, int CaptionId, DWORD Type, ...);
  67. extern int MsgBoxWinError(HWND hwndParent, int CaptionId, DWORD Type, DWORD Error = ERROR_SUCCESS);
  68. extern LRESULT dmNotifyWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  69. extern INT PromptForRestart(HWND hwndParent, DWORD RestartFlags, int ResId = 0);
  70. extern BOOL LoadEnumPropPage32(LPCTSTR RegString, HMODULE* pdll, FARPROC* pProcAddress);
  71. extern BOOL IsBlankChar(TCHAR ch);
  72. extern LPTSTR SkipBlankChars(LPTSTR psz);
  73. extern BOOL GuidFromString(LPCTSTR GuidString, LPGUID pGuid);
  74. extern BOOL GuidToString(LPGUID pGuid, LPTSTR Buffer, DWORD BufferLen);
  75. extern BOOL AddToolTips(HWND hDlg, UINT id, LPCTSTR pszText, HWND *phwnd);
  76. extern BOOL AddPropPageCallback(HPROPSHEETPAGE hPage, LPARAM lParam);
  77. STDAPI_(LPTSTR)
  78. AddCommas64(
  79. LONGLONG n,
  80. LPTSTR pszResult,
  81. UINT cchResult
  82. );
  83. STDAPI_(CONFIGRET) GetLocationInformation(
  84. DEVNODE dn,
  85. LPTSTR Location,
  86. ULONG LocationLen, // In characters
  87. HMACHINE hMachine
  88. );
  89. #if DBG
  90. extern void Trace(LPCTSTR format, ...);
  91. #define TRACE(text) Trace text
  92. #else
  93. #define TRACE(text)
  94. #endif
  95. #endif // __GLOBALS_H_