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.

216 lines
7.4 KiB

  1. // setupu.h
  2. //--- flags for win_type
  3. #define WIN_UNKNOWN 0
  4. #define WIN_NT 1
  5. #define WIN_95 2
  6. //--- country codes for SocketModem support
  7. #define mcNotUsed 0
  8. #define mcAustria 1
  9. #define mcBelgium 2
  10. #define mcDenmark 3
  11. #define mcFinland 4
  12. #define mcFrance 5
  13. #define mcGermany 6
  14. #define mcIreland 7
  15. #define mcItaly 8
  16. #define mcLuxembourg 9
  17. #define mcNetherlands 10
  18. #define mcNorway 11
  19. #define mcPortugal 12
  20. #define mcSpain 13
  21. #define mcSweden 14
  22. #define mcSwitzerland 15
  23. #define mcUK 16
  24. #define mcGreece 17
  25. #define mcIsrael 18
  26. #define mcCzechRep 19
  27. #define mcCanada 20
  28. #define mcMexico 21
  29. #define mcUSA 22
  30. #define mcNA mcUSA // North America
  31. #define mcHungary 23
  32. #define mcPoland 24
  33. #define mcRussia 25
  34. #define mcSlovacRep 26
  35. #define mcBulgaria 27
  36. // 28
  37. // 29
  38. #define mcIndia 30
  39. // 31
  40. // 32
  41. // 33
  42. // 34
  43. // 35
  44. // 36
  45. // 37
  46. // 38
  47. // 39
  48. #define mcAustralia 40
  49. #define mcChina 41
  50. #define mcHongKong 42
  51. #define mcJapan 43
  52. #define mcPhilippines mcJapan
  53. #define mcKorea 44
  54. // 45
  55. #define mcTaiwan 46
  56. #define mcSingapore 47
  57. #define mcNewZealand 48
  58. typedef struct {
  59. HINSTANCE hinst; // needed for some system calls
  60. int prompting_off; // turns prompting off(silent install).
  61. int win_type; // 0=unknown, 1=NT, 2=win95
  62. int major_ver;
  63. int minor_ver;
  64. // this holds the pnp-name we use as a registry key to hold
  65. // our device parameters in the registry for RocketPort & NT50
  66. char szNt50DevObjName[50]; // typical: "Device_002456
  67. char szServiceName[50]; // typical: "RocketPort"
  68. char szDriverName[50]; // typical: "Rocket.sys"
  69. char szAppDir[50]; // typical: "Rocket"
  70. char szAppName[150]; // typical: "RocketPort/RocketModem Setup"
  71. char src_dir[250]; // typical: "a:\"
  72. char dest_dir[250]; // typical: "c:\windows\system32\rocket
  73. // following are used as convenient buffer for build src/dest filenames
  74. char src_str[256];
  75. char dest_str[256];
  76. char tmpstr[256];
  77. } InstallPaths;
  78. //--- flags for io_sel[]
  79. #define PCI_SEL 1
  80. #define MCA_SEL 2
  81. //--- flags for install_type
  82. #define INS_NETWORK_INF 1 // traditional nt4.0 network install(oemsetup.inf)
  83. #define INS_NT50_INF 2 // plug n pray nt5.0 install(rocketpt.inf)
  84. #define INS_SIMPLE 3 // no inf, we installed
  85. typedef struct Port_Config; // forward decl.
  86. // option_flags: option to ignore some tx-buffering
  87. //#define OPT_WAITONTX 1
  88. // option_flags: option to always process with 485 control on rts signal
  89. //#define OPT_RS485_OVERRIDE 2
  90. // option_flags: option to process 485 rts to low(backward) to enable tx.
  91. //#define OPT_RS485_LOW 4
  92. // option_flags: option to map CD to DSR.
  93. //#define OPT_MAP_CDTODSR 8
  94. // option_flags: option to map 2 stop bits to 1
  95. //#define OPT_MAP_2TO1 10
  96. typedef struct {
  97. int index;
  98. char Name[16]; // actual com port name(example: "COM#")
  99. //char Desc[42]; // a user description tag for convience
  100. DWORD LockBaud; // override for the baud rate
  101. //DWORD Options; // see bit options
  102. DWORD WaitOnTx : 1;
  103. DWORD RS485Override : 1;
  104. DWORD RS485Low : 1;
  105. DWORD Map2StopsTo1 : 1;
  106. DWORD MapCdToDsr : 1;
  107. DWORD RingEmulate : 1;
  108. DWORD TxCloseTime; // seconds to wait for tx to finish spooling on close.
  109. HTREEITEM tvHandle; // treeview handle
  110. #ifdef NT50
  111. HANDLE hPnpNode; // handle to device node
  112. #endif
  113. } Port_Config;
  114. typedef struct {
  115. char Name[64]; // user designated name(limit to 59 chars please)
  116. char ModelName[50]; // (e.g., "RocketModem")
  117. BYTE MacAddr[6]; // mac addr, ff ff ff ff ff ff = auto
  118. int NumPorts;
  119. int ModemDevice; // 1=RocketModem & VS2000, 0=RocketPort & VS1000
  120. int HubDevice; // 1=SerialHub family, 0=VS family
  121. int IoAddress; // rocketport(0=not installed, 1=pci, 0x180 = def isa io)
  122. int StartComIndex; // first port(0=auto)
  123. int BackupServer; // 1=backup server, 0=normal server
  124. int BackupTimer; // delay timeout for backup to kick in(minutes)
  125. Port_Config *ports; // ptr to an array of ports config structs
  126. HTREEITEM tvHandle; // treeview handle
  127. int HardwareId; // Pnp reads in a unique id from the reg/inf files.
  128. } Device_Config;
  129. #define MAX_NUM_DEVICES 64
  130. typedef struct {
  131. int driver_type; // 0=rocketport, 1=vs1000...
  132. // NT4.0 used older network style INF files, we need to switch
  133. // to newer NT5.0 style INF files. As a alternative to both,
  134. // we allow running without an INF file where we copy over the
  135. // needed files and setup the registry directly.
  136. int install_style;
  137. int nt_reg_flags; // 1H=new install, 2H=Missing registry entries
  138. // following is array of device config structs.
  139. Device_Config *dev; // ptr to array of Device structs, up to MAX_NUM_DEVICES.
  140. int NumDevices;
  141. // following used to hold the current selection of io-addr, irq, etc.
  142. int irq_sel; //
  143. int ScanRate; // in millisecond units.
  144. int VerboseLog; // true if we want verbose event logging
  145. int NoPnpPorts; // true if nt5.0 pnp ports active
  146. int UseIRQ; // true if user wants to use an irq
  147. int ModemCountry; // modem country code for internal modem devices
  148. int GlobalRS485; // display RS485 options on all ports
  149. int DriverExitDone; // tells if we did all the Driver exit stuff.
  150. int NeedReset; // flag, true if we need a reset to invoke changes
  151. int ChangesMade; // flag, true if changes were made.
  152. InstallPaths ip;
  153. } Driver_Config;
  154. int APIENTRY setup_install_info(InstallPaths *ip,
  155. HINSTANCE hinst,
  156. char *NewServiceName,
  157. char *NewDriverName,
  158. char *NewAppName,
  159. char *NewAppDir);
  160. int APIENTRY remove_driver_reg_entries(char *ServiceName);
  161. int APIENTRY remove_pnp_reg_entries(void);
  162. DWORD APIENTRY RegDeleteKeyNT(HKEY hStartKey , LPTSTR pKeyName );
  163. int APIENTRY modem_inf_change(InstallPaths *ip,
  164. char *modemfile,
  165. char *szModemInfEntry);
  166. int APIENTRY backup_modem_inf(InstallPaths *ip);
  167. #define CHORE_INSTALL 1
  168. #define CHORE_START 2
  169. #define CHORE_STOP 3
  170. #define CHORE_REMOVE 4
  171. #define CHORE_INSTALL_SERVICE 5
  172. #define CHORE_IS_INSTALLED 6
  173. int APIENTRY service_man(LPSTR lpServiceName, LPSTR lpBinaryPath, int chore);
  174. int APIENTRY make_szSCS(char *str, const char *szName);
  175. int APIENTRY make_szSCSES(char *str, const char *szName);
  176. int APIENTRY copy_files(InstallPaths *ip, char **files);
  177. int APIENTRY our_copy_file(char *dest, char *src);
  178. int APIENTRY our_message(InstallPaths *ip, char *str, WORD option);
  179. int APIENTRY load_str(HINSTANCE hinst, int id, char *dest, int str_size);
  180. int APIENTRY our_id_message(InstallPaths *ip, int id, WORD prompt);
  181. void APIENTRY mess(InstallPaths *ip, char *format, ...);
  182. int APIENTRY unattended_add_port_entries(InstallPaths *ip,
  183. int num_entries,
  184. int start_port);
  185. TCHAR *RcStr(int msgstrindx);