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.

144 lines
3.3 KiB

  1. /*++
  2. Microsoft Confidential
  3. Copyright (c) 1992-1997 Microsoft Corporation
  4. All rights reserved
  5. Module Name:
  6. sysdm.h
  7. Abstract:
  8. Applet-wide declaraions and definitions for the
  9. System Control Panel Applet.
  10. Author:
  11. Eric Flo (ericflo) 19-Jun-1995
  12. Revision History:
  13. 15-Oct-1997 scotthal
  14. Complete overhaul
  15. --*/
  16. #ifndef _SYSDM_H_
  17. #define _SYSDM_H_
  18. #include <nt.h>
  19. #include <ntrtl.h>
  20. #include <nturtl.h>
  21. #include <ntexapi.h>
  22. #include <windows.h>
  23. #include <commctrl.h>
  24. #include <comctrlp.h>
  25. #include <shellapi.h>
  26. #include <shlobj.h>
  27. #include <shlobjp.h>
  28. #include <shlwapi.h>
  29. #include <shlwapip.h>
  30. #include <cpl.h>
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif // __cplusplus
  34. #include "resource.h"
  35. #include "helpid.h"
  36. #include "util.h"
  37. #include "sid.h"
  38. #include "general.h"
  39. #include "netid.h"
  40. #include "hardware.h"
  41. #include "hwprof.h"
  42. #include "profile.h"
  43. #include "advanced.h"
  44. #include "perf.h"
  45. #include "virtual.h"
  46. #include "startup.h"
  47. #include "envvar.h"
  48. #include "edtenvar.h"
  49. #include "syspart.h"
  50. #include "pfrscpl.h"
  51. #include "srcfg.h"
  52. #include "visualfx.h"
  53. //
  54. // Global variables
  55. //
  56. extern TCHAR g_szErrMem[ 200 ]; // Low memory message
  57. extern TCHAR g_szSystemApplet[ 100 ]; // "System Control Panel Applet" title
  58. extern HINSTANCE hInstance;
  59. extern TCHAR g_szNull[];
  60. extern BOOL g_fRebootRequired;
  61. //
  62. // Macros
  63. //
  64. #define ZeroInit(pv, cb) (memset((pv), 0, (cb)))
  65. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  66. #define SIZEOF(x) sizeof(x)
  67. #define SetLBWidth( hwndLB, szStr, cxCurWidth ) SetLBWidthEx( hwndLB, szStr, cxCurWidth, 0)
  68. #define IsPathSep(ch) ((ch) == TEXT('\\') || (ch) == TEXT('/'))
  69. #define IsWhiteSpace(ch) ((ch) == TEXT(' ') || (ch) == TEXT('\t') || (ch) == TEXT('\n') || (ch) == TEXT('\r'))
  70. #define IsDigit(ch) ((ch) >= TEXT('0') && (ch) <= TEXT('9'))
  71. #define DigitVal(ch) ((ch) - TEXT('0'))
  72. #define FmtFree(s) LocalFree(s) /* Macro to free FormatMessage allocated strings */
  73. #define MAX_PAGES 16 // Arbitrary Maximum number of pages in the System Control Panel.
  74. typedef HPROPSHEETPAGE (*PSPCALLBACK)(int idd, DLGPROC pfnDlgProc);
  75. typedef struct
  76. {
  77. PSPCALLBACK pfnCreatePage;
  78. int idd;
  79. DLGPROC pfnDlgProc;
  80. }
  81. PSPINFO;
  82. HPROPSHEETPAGE CreatePage(int idd, DLGPROC pfnDlgProc);
  83. //
  84. // Debugging macros
  85. //
  86. #if DBG
  87. # define DBG_CODE 1
  88. void DbgPrintf( LPTSTR szFmt, ... );
  89. void DbgStopX(LPSTR mszFile, int iLine, LPTSTR szText );
  90. HLOCAL MemAllocWorker(LPSTR szFile, int iLine, UINT uFlags, UINT cBytes);
  91. HLOCAL MemFreeWorker(LPSTR szFile, int iLine, HLOCAL hMem);
  92. void MemExitCheckWorker(void);
  93. # define MemAlloc( f, s ) MemAllocWorker( __FILE__, __LINE__, f, s )
  94. # define MemFree( h ) MemFreeWorker( __FILE__, __LINE__, h )
  95. # define MEM_EXIT_CHECK() MemExitCheckWorker()
  96. # define DBGSTOP( t ) DbgStopX( __FILE__, __LINE__, TEXT(t) )
  97. # define DBGSTOPX( f, l, t ) DbgStopX( f, l, TEXT(t) )
  98. # define DBGPRINTF(p) DbgPrintf p
  99. # define DBGOUT(t) DbgPrintf( TEXT("SYSDM.CPL: %s\n"), TEXT(t) )
  100. #else
  101. # define MemAlloc( f, s ) LocalAlloc( f, s )
  102. # define MemFree( h ) LocalFree( h )
  103. # define MEM_EXIT_CHECK()
  104. # define DBGSTOP( t )
  105. # define DBGSTOPX( f, l, t )
  106. # define DBGPRINTF(p)
  107. # define DBGOUT(t)
  108. #endif
  109. #ifdef __cplusplus
  110. } // extern "C"
  111. #endif // __cplusplus
  112. #endif // _SYSDM_H_