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.

122 lines
3.7 KiB

  1. /*++
  2. Copyright (C) 1997-1999 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_HasLoadDriverNamePrivilege;
  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. extern const TCHAR* const ENV_NAME_SYSTEMDRIVE;
  49. extern LPOLESTR AllocOleTaskString(LPCTSTR str);
  50. extern void FreeOleTaskString(LPOLESTR str);
  51. extern const NODEINFO NodeInfo[];
  52. //
  53. // global functions declaration
  54. //
  55. extern HRESULT AddMenuItem(LPCONTEXTMENUCALLBACK pCallback, int iNameStringId,
  56. int iStatusBarStringId, long lCommandId,
  57. long InsertionPointId, long Flags,
  58. long SpecialFlags = 0);
  59. extern BOOL VerifyMachineName(LPCTSTR MachineName);
  60. extern UINT LoadResourceString(int StringId, LPTSTR Buffer, UINT BufferSize);
  61. extern UINT GetDeviceProblemText(HMACHINE hMachine, DEVNODE DevNode, ULONG ProblemNumber, LPTSTR Buffer, UINT BufferSize);
  62. extern int MsgBoxParam(HWND hwnd, int MsgId, int CaptionId, DWORD Type, ...);
  63. extern int MsgBoxWinError(HWND hwndParent, int CaptionId, DWORD Type, DWORD Error = ERROR_SUCCESS);
  64. extern LRESULT dmNotifyWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  65. extern INT PromptForRestart(HWND hwndParent, DWORD RestartFlags, int ResId = 0);
  66. extern BOOL LoadEnumPropPage32(LPCTSTR RegString, HMODULE* pdll, FARPROC* pProcAddress);
  67. extern BOOL IsBlankChar(TCHAR ch);
  68. extern LPTSTR SkipBlankChars(LPTSTR psz);
  69. extern BOOL GuidFromString(LPCTSTR GuidString, LPGUID pGuid);
  70. extern BOOL GuidToString(LPGUID pGuid, LPTSTR Buffer, DWORD BufferLen);
  71. extern PCTSTR MyGetFileTitle(IN PCTSTR FilePath);
  72. extern BOOL AddToolTips(HWND hDlg, UINT id, LPCTSTR pszText, HWND *phwnd);
  73. extern BOOL AddPropPageCallback(HPROPSHEETPAGE hPage, LPARAM lParam);
  74. extern BOOL EnablePrivilege(PCTSTR PrivilegeName, BOOL Enable);
  75. const int MAX_PROP_PAGES = 64;
  76. #if DBG
  77. extern void Trace(LPCTSTR format, ...);
  78. #define TRACE(text) Trace text
  79. #else
  80. #define TRACE(text)
  81. #endif
  82. #define DI_NEEDPOWERCYCLE 0x400000L
  83. // Sizes of various stringized numbers
  84. #define MAX_INT64_SIZE 30 // 2^64 is less than 30 chars long
  85. #define MAX_COMMA_NUMBER_SIZE (MAX_INT64_SIZE + 10)
  86. STDAPI_(LPTSTR)
  87. AddCommas64(
  88. LONGLONG n,
  89. LPTSTR pszResult,
  90. UINT cchResult
  91. );
  92. #endif // __GLOBALS_H_