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.

126 lines
3.3 KiB

  1. //*************************************************************
  2. //
  3. // Header file for sysdm applet
  4. //
  5. // Microsoft Confidential
  6. // Copyright (c) 1996-1999 Microsoft Corporation
  7. // All rights reserved
  8. //
  9. //*************************************************************
  10. #pragma once
  11. #include <commctrl.h>
  12. #include "startup.h"
  13. #include "envvar.h"
  14. #include "resource.h"
  15. #include "..\Common\util.h"
  16. //
  17. // Global variables
  18. //
  19. extern HINSTANCE hInstance;
  20. extern TCHAR g_szNull[];
  21. //
  22. // Macros
  23. //
  24. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  25. #define SIZEOF(x) sizeof(x)
  26. #define SetLBWidth( hwndLB, szStr, cxCurWidth ) SetLBWidthEx( hwndLB, szStr, cxCurWidth, 0)
  27. #define IsPathSep(ch) ((ch) == TEXT('\\') || (ch) == TEXT('/'))
  28. #define IsWhiteSpace(ch) ((ch) == TEXT(' ') || (ch) == TEXT('\t') || (ch) == TEXT('\n') || (ch) == TEXT('\r'))
  29. #define IsDigit(ch) ((ch) >= TEXT('0') && (ch) <= TEXT('9'))
  30. #define DigitVal(ch) ((ch) - TEXT('0'))
  31. #define FmtFree(s) LocalFree(s) /* Macro to free FormatMessage allocated strings */
  32. //
  33. // Help IDs
  34. //
  35. #define HELP_FILE TEXT("sysdm.hlp")
  36. #define IDH_HELPFIRST 5000
  37. #define IDH_GENERAL (IDH_HELPFIRST + 0000)
  38. #define IDH_PERF (IDH_HELPFIRST + 1000)
  39. #define IDH_ENV (IDH_HELPFIRST + 2000)
  40. #define IDH_STARTUP (IDH_HELPFIRST + 3000)
  41. #define IDH_HWPROFILE (IDH_HELPFIRST + 4000)
  42. #define IDH_USERPROFILE (IDH_HELPFIRST + 5000)
  43. //
  44. // sysdm.c
  45. //
  46. int StringToInt( LPTSTR sz ); // TCHAR aware atoi()
  47. void IntToString( INT i, LPTSTR sz); // TCHAR aware itoa()
  48. LPTSTR SkipWhiteSpace( LPTSTR sz );
  49. BOOL IsUserAdmin(VOID);
  50. //
  51. // envar.c
  52. //
  53. DWORD SetLBWidthEx (HWND hwndLB, LPTSTR szBuffer, DWORD cxCurWidth, DWORD cxExtra);
  54. LPTSTR CloneString( LPTSTR pszSrc );
  55. //
  56. // virtual.c
  57. //
  58. VOID SetDlgItemMB(HWND hDlg, INT idControl, DWORD dwMBValue);
  59. int MsgBoxParam( HWND hWnd, DWORD wText, DWORD wCaption, DWORD wType, ... );
  60. void HourGlass( BOOL bOn );
  61. void ErrMemDlg( HWND hParent );
  62. VOID SetDefButton(HWND hwndDlg, int idButton);
  63. //
  64. // sid.c
  65. //
  66. LPTSTR GetSidString(void);
  67. VOID DeleteSidString(LPTSTR SidString);
  68. PSID GetUserSid (void);
  69. VOID DeleteUserSid(PSID Sid);
  70. //
  71. // Debugging macros
  72. //
  73. #if DBG
  74. # define DBG_CODE 1
  75. void DbgPrintf( LPTSTR szFmt, ... );
  76. void DbgStopX(LPSTR mszFile, int iLine, LPTSTR szText );
  77. HLOCAL MemAllocWorker(LPSTR szFile, int iLine, UINT uFlags, UINT cBytes);
  78. HLOCAL MemFreeWorker(LPSTR szFile, int iLine, HLOCAL hMem);
  79. void MemExitCheckWorker(void);
  80. # define MemAlloc( f, s ) MemAllocWorker( __FILE__, __LINE__, f, s )
  81. # define MemFree( h ) MemFreeWorker( __FILE__, __LINE__, h )
  82. # define MEM_EXIT_CHECK() MemExitCheckWorker()
  83. # define DBGSTOP( t ) DbgStopX( __FILE__, __LINE__, TEXT(t) )
  84. # define DBGSTOPX( f, l, t ) DbgStopX( f, l, TEXT(t) )
  85. # define DBGPRINTF(p) DbgPrintf p
  86. # define DBGOUT(t) DbgPrintf( TEXT("SYSCPL.CPL: %s\n"), TEXT(t) )
  87. #else
  88. # define MemAlloc( f, s ) LocalAlloc( f, s )
  89. # define MemFree( h ) LocalFree( h )
  90. # define MEM_EXIT_CHECK()
  91. # define DBGSTOP( t )
  92. # define DBGSTOPX( f, l, t )
  93. # define DBGPRINTF(p)
  94. # define DBGOUT(t)
  95. #endif