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.

177 lines
6.4 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // File: profwiz.h
  4. //
  5. // Module: CMAK.EXE
  6. //
  7. // Synopsis: Main include file for CMAK
  8. //
  9. // Copyright (c) 1996-1999 Microsoft Corporation
  10. //
  11. // Author: quintinb Created 08/06/98
  12. //
  13. //+----------------------------------------------------------------------------
  14. #ifndef _CMAK_H
  15. #define _CMAK_H
  16. //
  17. // System Includes
  18. //
  19. #include <windows.h> // includes basic windows functionality
  20. #include <commdlg.h>
  21. #include "commctrl.h"
  22. #include <cderr.h>
  23. #include <shellapi.h>
  24. #include <objbase.h>
  25. #include <string.h> // includes the string functions
  26. #include <prsht.h> // includes the property sheet functionality
  27. #include <stdio.h>
  28. #include <mbstring.h>
  29. #include <tchar.h>
  30. #include <htmlhelp.h>
  31. #include <ras.h>
  32. #include <raseapif.h>
  33. //
  34. // Constants for CMAK return Codes
  35. //
  36. const int CMAK_RETURN_ERROR = -1;
  37. const int CMAK_RETURN_SUCCESS = 1;
  38. const int CMAK_RETURN_CANCEL = 0;
  39. const DWORD MAX_LONG_SERVICE_NAME_LENGTH = 63;
  40. const DWORD MAX_SHORT_SERVICE_NAME_LENGTH = 8;
  41. const TCHAR* const c_pszCmakOpsChm = TEXT("cmak_ops.chm");
  42. //
  43. // Types
  44. //
  45. typedef struct IconMenuStruct {
  46. TCHAR szName[MAX_PATH+1];
  47. TCHAR szProgram[MAX_PATH+1];
  48. TCHAR szParams[MAX_PATH+1];
  49. struct IconMenuStruct * next;
  50. BOOL bDoCopy;
  51. }IconMenu;
  52. typedef struct ExtraDataStruct {
  53. TCHAR szName[MAX_PATH+1];
  54. TCHAR szPathname[MAX_PATH+1];
  55. }ExtraData;
  56. typedef struct RenameDataStruct {
  57. TCHAR szShortName[MAX_PATH+1];
  58. TCHAR szLongName[MAX_PATH+1];
  59. }RenameData;
  60. typedef struct ListBxStruct {
  61. TCHAR szName[MAX_PATH+1];
  62. void * ListBxData;
  63. struct ListBxStruct * next;
  64. }ListBxList;
  65. //
  66. // Our includes
  67. //
  68. #include "util.h"
  69. #include "customaction.h" // Custom action List class
  70. #include "netsettings.h" // network (DUN) settings functions
  71. #include "listview.h" // code to help with the custom action list view control
  72. #include "resource.h" // includes the definitions for the resources
  73. #include "base_str.h"
  74. #include "dl_str.h"
  75. #include "mgr_str.h"
  76. #include "pbk_str.h"
  77. #include "mon_str.h"
  78. #include "stp_str.h"
  79. #include "inf_str.h"
  80. #include "tunl_str.h"
  81. #include "profile_str.h"
  82. #include "conact_str.h"
  83. #include "dun_str.h"
  84. #include "reg_str.h"
  85. #include "ver_str.h"
  86. #include "wiz_str.h"
  87. #include "pwd_str.h"
  88. #include "cmdebug.h"
  89. #include "cmsetup.h"
  90. #include "cmakui.h" // HELP context IDs for the HTML help topics.
  91. #include "bmpimage.h"
  92. #include "cmakreg.h"
  93. //
  94. // Function Headers
  95. //
  96. DWORD RegisterBitmapClass(HINSTANCE hInst);
  97. void QS_WritePrivateProfileString(LPCTSTR pszSection, LPCTSTR pszItem, LPTSTR entry, LPCTSTR inifile);
  98. BOOL ReferencedDownLoad(void); // function to tell if referenced profiles contain download info
  99. void CopyNonLocalProfile(LPCTSTR pszName, LPCTSTR pszExistingProfileDir);
  100. void GetFileName(LPCTSTR lpPath,LPTSTR lpFileName);
  101. LPTSTR GetName(LPCTSTR lpPath); // get filename and return in static string
  102. BOOL GetShortFileName(LPTSTR lpFile,LPTSTR lpShortName);
  103. BOOL WriteCopy(HANDLE hInf, LPTSTR lpFile, BOOL bWriteShortName);
  104. BOOL WriteInfLine(HANDLE hInf,LPTSTR lpFile);
  105. BOOL WriteSrcInfLine(HANDLE hInf,LPTSTR lpFile);
  106. BOOL WriteSED(HWND hDlg, LPTSTR szFullFilePath, LPINT pFileNum, LPCTSTR szSed);
  107. BOOL createListBxRecord(ListBxList ** HeadPtrListBx,ListBxList ** TailPtrListBx,void * pDnsData, DWORD dwSize, LPCTSTR lpName);
  108. void DeleteListBxRecord(ListBxList ** HeadPtrListBx,ListBxList ** TailPtrListBx, LPTSTR lpName);
  109. BOOL IsFile8dot3(LPTSTR pszFileName);
  110. LRESULT GetTextFromControl(IN HWND hDlg, IN int nCtrlId, OUT LPTSTR pszCharBuffer, IN DWORD dwCharInBuffer, BOOL bDisplayError);
  111. BOOL VerifyFile(HWND hDlg, DWORD ctrlID, LPTSTR lpFile, BOOL ShowErr);
  112. void RefreshComboList(HWND hwndDlg, ListBxList * HeadPtr);
  113. int DoBrowse(HWND hDlg, UINT* pFilterArray, LPTSTR* pMaskArray, UINT uNumFilters, int IDC_EDIT, LPCTSTR lpDefExt, LPTSTR lpFile);
  114. BOOL GetLangFromInfTemplate(LPCTSTR szFullInfPath, OUT LPTSTR pszLanguageDisplayName, IN int iCharsInBuffer);
  115. BOOL CreateMergedProfile(void);
  116. void FreeList(ListBxList ** pHeadPtr, ListBxList ** pTailPtr);
  117. void CheckNameChange(LPTSTR lpold, LPTSTR lpnew);
  118. BOOL FindListItemByName(LPTSTR lpName, ListBxList * pHeadOfList, ListBxList** pFoundItem);
  119. void RefreshList(HWND hwndDlg, UINT uCrtlId, ListBxList * HeadPtr);
  120. BOOL WriteInf(HANDLE hInf,LPCTSTR str);
  121. void FreeIconMenu();
  122. BOOL ReadIconMenu(LPCTSTR pszCmsFile, LPCTSTR pszProfilesDir);
  123. BOOL SetWindowLongWrapper(HWND hWnd, int nIndex, LONG dwNewLong);
  124. BOOL CopyFileWrapper(LPCTSTR lpExistingFileName, LPCTSTR lpNewFileName, BOOL bFailIfExists);
  125. BOOL CheckDiskSpaceForCompression (LPCTSTR szSedFile);
  126. int GetFilePath(LPCTSTR lpFullPath, LPTSTR lpPath);
  127. BOOL GetIconMenuItem(LPTSTR lpName,IconMenu * EditItem);
  128. void ClearCmakGlobals(void);
  129. BOOL RenameSection(LPCTSTR szCurrentSectionName, LPCTSTR szNewSectionName, LPCTSTR szFile);
  130. BOOL WriteRegStringValue(HKEY hBaseKey, LPCTSTR pszKeyName, LPCTSTR pszValueName, LPCTSTR pszValueToWrite);
  131. int ShowMessage(HWND hDlg, UINT strID, UINT mbtype);
  132. INT_PTR APIENTRY ProcessCustomActionPopup(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  133. INT_PTR CreateWizard(HWND);
  134. void FillInPropertyPage(PROPSHEETPAGE* , int, DLGPROC);
  135. INT_PTR APIENTRY ProcessHelp(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam, DWORD_PTR dwHelpId);
  136. void SetDefaultGUIFont(HWND hDlg, UINT message, int ctlID);
  137. BOOL FindSwitchInString(LPCTSTR pszStringToSearch, LPCTSTR pszSwitchToFind, BOOL bReturnNextToken, LPTSTR pszToken);
  138. HRESULT BuildCustomActionParamString(LPTSTR* aArrayOfStrings, UINT uCountOfStrings, LPTSTR* ppszParamsOutput);
  139. LPTSTR GetPrivateProfileStringWithAlloc(LPCTSTR pszSection, LPCTSTR pszKey, LPCTSTR pszDefault, LPCTSTR pszFile);
  140. int GetCurrentEditControlTextAlloc(HWND hEditText, LPTSTR* ppszText);
  141. BOOL BuildProfileExecutable(HWND hDlg);
  142. BOOL RemoveBracketsFromSectionString(LPTSTR *ppszSection);
  143. //
  144. // Routines written to upgrade an inf. Called from CopyToTempDir
  145. //
  146. int GetInfVersion(LPTSTR szFullPathToInfFile);
  147. BOOL UpgradeInf(LPCTSTR szRenamedInfFile, LPCTSTR szFullPathToInfFile);
  148. BOOL WriteInfVersion(LPTSTR szFullPathToInfFile, int iVersion = PROFILEVERSION);
  149. //
  150. // externs
  151. //
  152. extern CustomActionList* g_pCustomActionList;
  153. extern HINSTANCE g_hInstance;
  154. extern TCHAR g_szAppTitle[MAX_PATH+1];
  155. extern TCHAR g_szOsdir[MAX_PATH+1];
  156. #endif //_CMAK_H