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.

143 lines
5.1 KiB

  1. //--- setup.h
  2. // pluck the version out of ourver.h
  3. #define VERSION_STRING VER_PRODUCTVERSION_STR
  4. #define NUM_DRIVER_SHEETS 2
  5. // these are now defined in the individual make files
  6. //#define NT50
  7. //#define S_VS // vslink
  8. //#define S_RK // rocketport
  9. #define CharSizeOf(s) (sizeof(s) / sizeof(TCHAR))
  10. // for vs1000, which can have 64 ports:
  11. #define MAX_NUM_PORTS_PER_DEVICE 64
  12. // property sheet message sent to other sheets at same level
  13. // to gather up changes
  14. // from windows controls into our c-structs.
  15. #define QUERYSIB_GET_OUR_PROPS 100
  16. //---- macro to see if mac-addresses match
  17. #define mac_match(_addr1, _addr2) \
  18. ( (*((DWORD *)_addr1) == *((DWORD *)_addr2) ) && \
  19. (*((WORD *)(_addr1+4)) == *((WORD *)(_addr2+4)) ) )
  20. #define BOARD_SELECTED 0
  21. #define PORT_SELECTED 1
  22. typedef struct {
  23. HDEVINFO DeviceInfoSet; // a plug & play context handle
  24. PSP_DEVINFO_DATA DeviceInfoData; // a plug & play context handle
  25. int device_selected; // the current/selected device(board or vs-box)
  26. int port_selected; // the current/selected port
  27. int selected; // tree view selection: 0=board selected, 1=port
  28. } OUR_INFO;
  29. typedef struct {
  30. int IsIsa; // isa? 0 = pci bus
  31. int IsHub; // serial hub? 0 = VS1000/2000
  32. int IoAddress; // io base address
  33. int IsModemDev; // 1=VS2000 or RocketModem
  34. int CountryIdx; // list index for country code
  35. int CountryCode; // actual country code
  36. int NumPorts; // number of ports on board
  37. char BoardType[50]; // name of board model (e.g., RocketModem)
  38. BYTE MacAddr[6]; // mac addr, ff ff ff ff ff ff = auto
  39. int finished; // flag
  40. int BackupServer; // 1=backup server, 0=normal server
  41. int BackupTimer; // delay timeout for backup to kick in(minutes)
  42. } AddWiz_Config;
  43. #define TYPE_RM_VS2000 1
  44. #define TYPE_RMII 2
  45. #define TYPE_RM_i 3
  46. int DoDriverPropPages(HWND hwndOwner);
  47. int allow_exit(int want_to_cancel);
  48. void our_exit(void);
  49. // for flags in setup_service
  50. #define OUR_REMOVE 1
  51. #define OUR_RESTART 2
  52. #define OUR_INSTALL_START 4
  53. // for which_service in setup_service
  54. #define OUR_SERVICE 0
  55. #define OUR_DRIVER 1
  56. int setup_service(int flags, int which_service);
  57. int our_help(InstallPaths *ip, int index);
  58. void our_context_help(LPARAM lParam);
  59. int ioctl_talk(unsigned char *buf, int ioctl_type,
  60. unsigned char **ret_buf, int *ret_size);
  61. int update_modem_inf(int ok_prompt);
  62. int setup_utils_exist(void);
  63. int setup_make_progman_group(int prompt);
  64. int setup_init(void);
  65. int copy_setup_init(void);
  66. int remove_driver(int all);
  67. int send_to_driver(int send_it);
  68. int do_install(void);
  69. int FillDriverPropertySheets(PROPSHEETPAGE *psp, LPARAM our_params);
  70. int get_mac_list(char *buf, int in_buf_size, int *ret_buf_size);
  71. BYTE *our_get_ping_list(int *ret_stat, int *ret_bytes);
  72. int validate_config(int auto_correct);
  73. int validate_port(Port_Config *ps, int auto_correct);
  74. int validate_port_name(Port_Config *ps, int auto_correct);
  75. int validate_device(Device_Config *dev, int auto_correct);
  76. int FormANewComPortName(IN OUT TCHAR *szComName, IN TCHAR *szDefName);
  77. int IsPortNameInSetupUse(IN TCHAR *szComName);
  78. int IsPortNameInRegUse(IN TCHAR *szComName);
  79. int GetLastValidName(IN OUT TCHAR *szComName);
  80. void rename_ascending(int device_selected,
  81. int port_selected);
  82. int StripNameNum(IN OUT TCHAR *szComName);
  83. int ExtractNameNum(IN TCHAR *szComName);
  84. int BumpPortName(IN OUT TCHAR *szComName);
  85. /* PCI Defines(copied from ssci.h in driver code) */
  86. #define PCI_VENDOR_ID 0x11fe
  87. #define PCI_DEVICE_32I 0x0001
  88. #define PCI_DEVICE_8I 0x0002
  89. #define PCI_DEVICE_16I 0x0003
  90. #define PCI_DEVICE_4Q 0x0004
  91. #define PCI_DEVICE_8O 0x0005
  92. #define PCI_DEVICE_8RJ 0x0006
  93. #define PCI_DEVICE_4RJ 0x0007
  94. #define PCI_DEVICE_SIEMENS8 0x0008
  95. #define PCI_DEVICE_SIEMENS16 0x0009
  96. #define PCI_DEVICE_RPLUS4 0x000a
  97. #define PCI_DEVICE_RPLUS8 0x000b
  98. #define PCI_DEVICE_RMODEM6 0x000c
  99. #define PCI_DEVICE_RMODEM4 0x000d
  100. #define PCI_DEVICE_RPLUS2 0x000e
  101. #define PCI_DEVICE_422RPLUS2 0x000f
  102. /*-------------------------- Global Variables ---------------------*/
  103. //extern char *aptitle;
  104. extern char *szAppName;
  105. extern char *OurServiceName;
  106. extern char *OurDriverName;
  107. extern char *OurAppDir;
  108. extern char *szSetup_hlp;
  109. extern char szAppTitle[];
  110. extern char *szDeviceNames[];
  111. extern char *progman_list_nt[];
  112. extern unsigned char broadcast_addr[6];
  113. extern unsigned char mac_zero_addr[6];
  114. extern HWND glob_hwnd;
  115. extern HINSTANCE glob_hinst; // current instance
  116. extern char gtmpstr[250];
  117. extern HWND glob_hDlg;
  118. extern int glob_device_index;
  119. extern OUR_INFO *glob_info;
  120. extern AddWiz_Config *glob_add_wiz;
  121. extern Driver_Config *wi; // current info
  122. extern Driver_Config *org_wi; // original info, use to detect changes
  123. //extern Driver_Config *adv_org_wi; // original info, use to detect changes