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.

198 lines
5.0 KiB

  1. /*************************************************************************
  2. *
  3. * COMMON.H
  4. *
  5. * Common header file
  6. *
  7. * Copyright (c) 1995 Microsoft Corporation
  8. *
  9. * $Log: N:\NT\PRIVATE\NW4\NWSCRIPT\INC\VCS\COMMON.H $
  10. *
  11. * Rev 1.3 22 Dec 1995 14:20:06 terryt
  12. * Add Microsoft headers
  13. *
  14. * Rev 1.2 22 Nov 1995 15:44:26 terryt
  15. * Use proper NetWare user name call
  16. *
  17. * Rev 1.1 20 Nov 1995 15:18:46 terryt
  18. * Context and capture changes
  19. *
  20. * Rev 1.0 15 Nov 1995 18:05:30 terryt
  21. * Initial revision.
  22. *
  23. * Rev 1.2 25 Aug 1995 17:03:32 terryt
  24. * CAPTURE support
  25. *
  26. * Rev 1.1 26 Jul 1995 16:01:12 terryt
  27. * Get rid of unneccessary externs
  28. *
  29. * Rev 1.0 15 May 1995 19:09:28 terryt
  30. * Initial revision.
  31. *
  32. *************************************************************************/
  33. #include <nt.h>
  34. #include <ntrtl.h>
  35. #include <nturtl.h>
  36. #include <stdio.h>
  37. #include <conio.h>
  38. #include <stdlib.h>
  39. #include <string.h>
  40. #include <stdlib.h>
  41. #include <windows.h>
  42. #include <nds.h>
  43. #include <ndsapi32.h>
  44. #include <nwapi32.h>
  45. #include "dbcs.h"
  46. #include "inc\nwlibs.h"
  47. #include "nwscript.h"
  48. #define MAX_NAME_LEN 48
  49. #define MAX_PASSWORD_LEN 128
  50. #define MAX_PATH_LEN 304 //From NW programmer's guide p268.
  51. /* for map only */
  52. #define MAX_VOLUME_LEN 256 // 17 for 3X
  53. #define MAX_DIR_PATH_LEN 256
  54. /* for capture only */
  55. #define MAX_JOB_NAME_LEN 32
  56. #define MAX_QUEUE_NAME_LEN 1024
  57. #define MAX_BANNER_USER_NAME 13
  58. /* for common only */
  59. #define PATH_SEPERATOR ";"
  60. /* For building time/date strings */
  61. #define TIMEDATE_SIZE 64
  62. /*
  63. Function definations
  64. */
  65. /* used by login.c and script.c */
  66. void BreakOff(void);
  67. void BreakOn(void);
  68. /* used by common setpass*/
  69. void xstrupr(char *buffer);
  70. void ReadPassword(char * Password);
  71. /* used by map attach login*/
  72. int CAttachToFileServer(char *ServerName, unsigned int *pConn, int * pbAlreadyAttached);
  73. int Login(char *UserName, char *ServerName, char *Password, int bReadPassword);
  74. /* used by map attach login*/
  75. int ReadName (char * Name);
  76. /* used by map login */
  77. void DisplayError(int error ,char *functionName);
  78. char * GetDosEnv1(void);
  79. char * NWGetPath(void);
  80. int GetRestEnvLen (char *lpRest);
  81. int MemorySegmentLargeEnough (int nInsertByte);
  82. int IsSearchDrive(int driveNum);
  83. int GetDriveFromSearchNumber (int searchNumber);
  84. /* used by login logout*/
  85. void SetLoginDirectory (PBYTE);
  86. /* used by all */
  87. int Map (char * buffer);
  88. void DisplayMapping(void);
  89. int CGetDefaultConnectionID ( unsigned int * pConn );
  90. int GetConnectionInfo (unsigned int conn,
  91. char * serverName,
  92. char * userName,
  93. unsigned int * pconnNum,
  94. unsigned char * loginTime);
  95. extern char * LOGIN_NAME;
  96. extern char *NDS_FULL_NAME;
  97. extern char *REQUESTER_CONTEXT;
  98. extern char *TYPED_USER_NAME;
  99. extern PWCHAR TYPED_USER_NAME_w;
  100. extern PBYTE NDSTREE;
  101. extern PWCHAR NDSTREE_w;
  102. extern UNICODE_STRING NDSTREE_u;
  103. extern PBYTE PREFERRED_SERVER;
  104. /*
  105. String definitions.
  106. */
  107. extern char *__Day__[7];
  108. extern char *__Month__[12];
  109. extern char *__AMPM__[2];
  110. extern char *__GREETING__[3];
  111. extern char __DEL__[];
  112. extern char __REM__[];
  113. extern char __INS__[];
  114. extern char __ROOT__[];
  115. extern char __NEXT__[];
  116. extern char __AUTOENDCAP__[];
  117. extern char __BANNER__[];
  118. extern char __COPIES__[];
  119. extern char __CREATE__[];
  120. extern WCHAR __DISABLED__[];
  121. extern WCHAR __ENABLED__[];
  122. extern WCHAR __YES__[];
  123. extern WCHAR __NO__[];
  124. extern WCHAR __SECONDS__[];
  125. extern WCHAR __CONVERT_TO_SPACE__[];
  126. extern WCHAR __NO_CONVERSION__[];
  127. extern WCHAR __NOTIFY_USER__[];
  128. extern WCHAR __NOT_NOTIFY_USER__[];
  129. extern WCHAR __NONE__[];
  130. extern char __FORMFEED__[];
  131. extern char __FORM__[];
  132. extern char __JOB_DESCRIPTION__[];
  133. extern char __JOB__[];
  134. extern char __KEEP__[];
  135. extern char __LOCAL__[];
  136. extern char __LOCAL_2__[];
  137. extern char __LOCAL_3__[];
  138. extern char __NAME__[];
  139. extern char __NOAUTOENDCAP__[];
  140. extern char __NOBANNER__[];
  141. extern char __NOFORMFEED__[];
  142. extern char __NONOTIFY__[];
  143. extern char __NOTABS__[];
  144. extern char __NOTIFY__[];
  145. extern char __QUEUE__[];
  146. extern char __PRINTER__[];
  147. extern char __OPT_NO__[];
  148. extern char __SERVER__[];
  149. extern char __SHORT_FOR_AUTOENDCAP__[];
  150. extern char __SHORT_FOR_BANNER__[];
  151. extern char __SHORT_FOR_COPIES__[];
  152. extern char __SHORT_FOR_CREATE__[];
  153. extern char __SHORT_FOR_FORMFEED__[];
  154. extern char __SHORT_FOR_FORM__[];
  155. extern char __SHORT_FOR_JOB__[];
  156. extern char __SHORT_FOR_KEEP__[];
  157. extern char __SHORT_FOR_LOCAL__[];
  158. extern char __SHORT_FOR_NAME__[];
  159. extern char __SHORT_FOR_NOAUTOENDCAP__[];
  160. extern char __SHORT_FOR_NOBANNER__[];
  161. extern char __SHORT_FOR_NOFORMFEED__[];
  162. extern char __SHORT_FOR_NONOTIFY__[];
  163. extern char __SHORT_FOR_NOTABS__[];
  164. extern char __SHORT_FOR_NOTIFY__[];
  165. extern char __SHORT_FOR_QUEUE__[];
  166. extern char __SHORT_FOR_PRINTER__[];
  167. extern char __SHORT_FOR_SERVER__[];
  168. extern char __SHORT_FOR_TABS__[];
  169. extern char __SHORT_FOR_TIMEOUT__[];
  170. extern char __SHOW__[];
  171. extern char __TABS__[];
  172. extern char __TIMEOUT__[];
  173. extern unsigned int CaptureStringsLoaded;
  174. extern unsigned int fNDS;