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.

725 lines
18 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. dos2nt.h
  5. Abstract:
  6. Local include file for DOS based NT Setup program.
  7. Author:
  8. Ted Miller (tedm) 30-March-1992
  9. Revision History:
  10. --*/
  11. #include <setupbat.h>
  12. #include "nttypes.h"
  13. #include <stdio.h>
  14. #include "dninf.h"
  15. #include "sptxtcns.h"
  16. #include <stdarg.h>
  17. #include "SetupSxs.h"
  18. //
  19. // Define structure used to hold a text screen.
  20. //
  21. typedef struct _SCREEN {
  22. UCHAR X;
  23. UCHAR Y;
  24. PCHAR Strings[];
  25. } SCREEN, *PSCREEN;
  26. //
  27. // Define structure that contains information about disk space requirements
  28. //
  29. typedef struct _SPACE_REQUIREMENT {
  30. PCHAR Key;
  31. unsigned ClusterSize;
  32. ULONG Clusters;
  33. } SPACE_REQUIREMENT, *PSPACE_REQUIREMENT;
  34. //
  35. // define virtualized keycodes
  36. //
  37. #define ASCI_BS 8
  38. #define ASCI_CR 13
  39. #define ASCI_ESC 27
  40. #define DN_KEY_UP 0x00010000
  41. #define DN_KEY_DOWN 0x00020000
  42. #define DN_KEY_HOME 0x00030000
  43. #define DN_KEY_END 0x00040000
  44. #define DN_KEY_PAGEUP 0x00050000
  45. #define DN_KEY_PAGEDOWN 0x00060000
  46. #define DN_KEY_F1 0x01000000
  47. #define DN_KEY_F2 0x02000000
  48. #define DN_KEY_F3 0x03000000
  49. #define DN_KEY_F4 0x04000000
  50. //
  51. // define characters for radio buttons
  52. //
  53. #define RADIO_ON ((CHAR)'X')
  54. #define RADIO_OFF ((CHAR)' ')
  55. //
  56. // Display functions
  57. //
  58. VOID
  59. DnInitializeDisplay(
  60. VOID
  61. );
  62. VOID
  63. DnClearClientArea(
  64. VOID
  65. );
  66. VOID
  67. DnSetGaugeAttribute(
  68. IN BOOLEAN Set
  69. );
  70. VOID
  71. DnPositionCursor(
  72. IN UCHAR X,
  73. IN UCHAR Y
  74. );
  75. VOID
  76. DnWriteChar(
  77. IN CHAR chr
  78. );
  79. VOID
  80. DnWriteString(
  81. IN PCHAR String
  82. );
  83. VOID
  84. DnWriteStatusText(
  85. IN PCHAR FormatString OPTIONAL,
  86. ...
  87. );
  88. VOID
  89. DnSetCopyStatusText(
  90. IN PCHAR Caption,
  91. IN PCHAR Filename
  92. );
  93. VOID
  94. DnStartEditField(
  95. IN BOOLEAN CreateField,
  96. IN UCHAR X,
  97. IN UCHAR Y,
  98. IN UCHAR W
  99. );
  100. VOID
  101. DnExitDialog(
  102. VOID
  103. );
  104. VOID
  105. DnDelnode(
  106. IN PCHAR Directory
  107. );
  108. //
  109. // Gas guage functions
  110. //
  111. int
  112. DnGetGaugeChar(
  113. VOID
  114. );
  115. VOID
  116. DnInitGauge(
  117. IN unsigned NumberOfFiles,
  118. IN PSCREEN AdditionalScreen OPTIONAL
  119. );
  120. VOID
  121. DnTickGauge(
  122. VOID
  123. );
  124. VOID
  125. DnDrawGauge(
  126. IN PSCREEN AdditionalScreen OPTIONAL
  127. );
  128. //
  129. // asm routines in dna.asm
  130. //
  131. VOID
  132. DnaReboot(
  133. VOID
  134. );
  135. BOOLEAN
  136. _far
  137. _cdecl
  138. DnAbsoluteSectorIo(
  139. IN unsigned Drive, //0=A, etc
  140. IN ULONG StartSector,
  141. IN USHORT SectorCount,
  142. IN OUT PVOID Buffer,
  143. IN BOOLEAN Write
  144. );
  145. //
  146. // Misc / util functions
  147. //
  148. BOOLEAN
  149. DnWriteSmallIniFile(
  150. IN PCHAR Filename,
  151. IN PCHAR *Lines,
  152. OUT FILE **FileHandle OPTIONAL
  153. );
  154. ULONG
  155. DnGetKey(
  156. VOID
  157. );
  158. ULONG
  159. DnGetValidKey(
  160. IN PULONG ValidKeyList
  161. );
  162. VOID
  163. DnDisplayScreen(
  164. IN PSCREEN Screen,
  165. ...
  166. );
  167. VOID
  168. vDnDisplayScreen(
  169. IN PSCREEN Screen,
  170. IN va_list arglist
  171. );
  172. VOID
  173. DnFatalError(
  174. IN PSCREEN Screen,
  175. ...
  176. );
  177. BOOLEAN
  178. DnCopyError(
  179. IN PCHAR Filename,
  180. IN PSCREEN ErrorScreen,
  181. IN int FilenameLine
  182. );
  183. PCHAR
  184. DnDupString(
  185. IN PCHAR String
  186. );
  187. VOID
  188. DnGetString(
  189. IN OUT PCHAR String,
  190. IN UCHAR X,
  191. IN UCHAR Y,
  192. IN UCHAR W
  193. );
  194. BOOLEAN
  195. DnIsDriveValid(
  196. IN unsigned Drive
  197. );
  198. BOOLEAN
  199. DnIsDriveRemote(
  200. IN unsigned Drive,
  201. OUT PCHAR UncPath OPTIONAL
  202. );
  203. BOOLEAN
  204. DnIsDriveRemovable(
  205. IN unsigned Drive
  206. );
  207. BOOLEAN
  208. DnCanonicalizePath(
  209. IN PCHAR PathIn,
  210. OUT PCHAR PathOut
  211. );
  212. VOID
  213. DnRemoveTrailingSlashes(
  214. PCHAR Path
  215. );
  216. VOID
  217. DnRemoveLastPathElement(
  218. PCHAR Path
  219. );
  220. VOID
  221. DnpConcatPaths(
  222. IN PCHAR SourceBuffer,
  223. IN PCHAR AppendString
  224. );
  225. BOOLEAN
  226. DnIsDriveCompressedVolume(
  227. IN unsigned Drive,
  228. OUT unsigned *HostDrive
  229. );
  230. #if 1
  231. PVOID
  232. Malloc(
  233. IN unsigned Size,
  234. IN BOOLEAN MustSucceed
  235. #if DBG
  236. ,IN char *file,
  237. IN int line
  238. #endif
  239. );
  240. VOID
  241. Free(
  242. IN PVOID Block
  243. #if DBG
  244. ,IN char *file,
  245. IN int line
  246. #endif
  247. );
  248. PVOID
  249. Realloc(
  250. IN PVOID Block,
  251. IN unsigned Size,
  252. IN BOOLEAN MustSucceed
  253. #if DBG
  254. ,IN char *file,
  255. IN int line
  256. #endif
  257. );
  258. #if DBG
  259. #define MALLOC(s,f) Malloc(s,f,__FILE__,__LINE__)
  260. #define REALLOC(b,s,f) Realloc(b,s,f,__FILE__,__LINE__)
  261. #define FREE(b) Free(b,__FILE__,__LINE__)
  262. #else
  263. #define MALLOC(s,f) Malloc(s,f)
  264. #define REALLOC(b,s,f) Realloc(b,s,f)
  265. #define FREE(b) Free(b)
  266. #endif
  267. #else
  268. #include <malloc.h>
  269. #define MALLOC(s,f) malloc(s)
  270. #define REALLOC(b,s,f) realloc(b,s)
  271. #define FREE(b) free(b)
  272. #endif
  273. VOID
  274. DnExit(
  275. IN int ExitStatus
  276. );
  277. //
  278. // File copy routines
  279. //
  280. //
  281. // Flags for various routines
  282. //
  283. #define CPY_VALIDATION_PASS 0x0001
  284. #define CPY_USE_DEST_ROOT 0x0002
  285. #define CPY_VERIFY 0x0004
  286. #define CPY_PRESERVE_ATTRIBS 0x0008
  287. #define CPY_PRESERVE_NAME 0x0010
  288. #define CPY_PRUNE_DRIVERCAB 0x0020
  289. VOID
  290. DnCopyFiles(
  291. VOID
  292. );
  293. ULONG
  294. DnpIterateOptionalDirs(
  295. IN unsigned Flags,
  296. IN unsigned ClusterSize OPTIONAL,
  297. IN PSPACE_REQUIREMENT SpaceReqArray OPTIONAL,
  298. IN unsigned ArraySize OPTIONAL
  299. );
  300. VOID
  301. DnCopyFloppyFiles(
  302. IN PCHAR SectionName,
  303. IN PCHAR TargetRoot
  304. );
  305. VOID
  306. DnCopyFilesInSection(
  307. IN unsigned Flags,
  308. IN PCHAR SectionName,
  309. IN PCHAR SourcePath,
  310. IN PCHAR TargetPath
  311. );
  312. #if NEC_98
  313. VOID
  314. DnCopyFilesInSectionForFDless(
  315. IN PCHAR SectionName,
  316. IN PCHAR SourcePath,
  317. IN PCHAR TargetPath
  318. );
  319. #endif // NEC_98
  320. VOID
  321. DnCopyOemBootFiles(
  322. PCHAR TargetPath
  323. );
  324. VOID
  325. DnDetermineSpaceRequirements(
  326. PSPACE_REQUIREMENT SpaceReqArray,
  327. unsigned ArraySize
  328. );
  329. VOID
  330. DnAdjustSpaceRequirements(
  331. PSPACE_REQUIREMENT SpaceReqArray,
  332. unsigned ArraySize
  333. );
  334. //
  335. // Local source functions.
  336. //
  337. VOID
  338. DnRemoveLocalSourceTrees(
  339. VOID
  340. );
  341. VOID
  342. DnRemovePagingFiles(
  343. VOID
  344. );
  345. //
  346. // Function to create the setup boot floppy
  347. //
  348. VOID
  349. DnCreateBootFloppies(
  350. VOID
  351. );
  352. //
  353. // Function to start NT text mode setup
  354. //
  355. VOID
  356. DnToNtSetup(
  357. VOID
  358. );
  359. //
  360. // Global variables
  361. //
  362. extern PCHAR LocalSourceDirName; // name of local src root (\$WIN_NT$.~LS)
  363. extern PCHAR x86DirName; // name of x86-specific subdir (\I386")
  364. extern PCHAR DngSourceRootPath; // root of source ('x:\foo\bar', '\\foo\bar')
  365. extern PCHAR UserSpecifiedOEMShare; // possible alternate location for $OEM$ files.
  366. extern CHAR DngTargetDriveLetter; // drive letter of target
  367. extern CHAR DngSwapDriveLetter; // drive letter for INF parser swap file
  368. extern PCHAR DngTargetPath; // path part of target from leading \.
  369. extern PVOID DngInfHandle; // To be passed to INF routines
  370. extern PVOID DngDrvindexInfHandle; // To be passed to INF routines
  371. extern BOOLEAN DngFloppyVerify; // whether to verify files copied to floppy
  372. extern BOOLEAN DngWinntFloppies; // whether floppies are for winnt or cd/floppy
  373. extern BOOLEAN DngCheckFloppySpace; // whether to check free space on the floppy
  374. extern unsigned DngOriginalCurrentDrive; // current drive when we were invoked
  375. extern BOOLEAN DngFloppyless; // whether to do floppyless operation
  376. extern BOOLEAN DngServer; // true if setting up server; false for workstation
  377. extern BOOLEAN DngUnattended; // skip final reboot screen
  378. extern BOOLEAN DngWindows; // Are we running under Windows?
  379. extern BOOLEAN DngCopyOnlyD1TaggedFiles; // TRUE if the files tagged with d1 only need to be copied
  380. extern PCHAR DngScriptFile;
  381. extern BOOLEAN DngOemPreInstall;
  382. extern PCHAR OemSystemDirectory;
  383. extern PCHAR OemOptionalDirectory;
  384. extern PCHAR UniquenessDatabaseFile;
  385. extern PCHAR UniquenessId;
  386. extern BOOLEAN DngMagnifier; // Accessibility utilities
  387. extern BOOLEAN DngKeyboard;
  388. extern BOOLEAN DngTalker;
  389. extern BOOLEAN DngVoice;
  390. //
  391. // Name of sections and keys in inf file.
  392. //
  393. extern CHAR __far DnfDirectories[];
  394. extern CHAR __far DnfFiles[];
  395. extern CHAR __far DnfFloppyFiles0[];
  396. extern CHAR __far DnfFloppyFiles1[];
  397. extern CHAR __far DnfFloppyFiles2[];
  398. extern CHAR __far DnfFloppyFiles3[];
  399. extern CHAR __far DnfFloppyFilesX[];
  400. extern CHAR __far DnfSpaceRequirements[];
  401. extern CHAR __far DnfMiscellaneous[];
  402. extern CHAR __far DnfRootBootFiles[];
  403. extern CHAR __far DnfAssemblyDirectories[];
  404. #if NEC_98
  405. extern CHAR DnfBackupFiles_PC98[]; // For FD Less Setup
  406. #endif // NEC_98
  407. extern CHAR DnkBootDrive[];
  408. extern CHAR DnkNtDrive[];
  409. extern CHAR __far DnkMinimumMemory[];
  410. //
  411. // Text strings
  412. //
  413. extern CHAR __far DntMsWindows[]; // "Microsoft Windows"
  414. extern CHAR __far DntMsDos[]; // "MS-DOS"
  415. extern CHAR __far DntPcDos[]; // "PC-DOS"
  416. extern CHAR __far DntOs2[]; // "OS/2"
  417. extern CHAR __far DntPreviousOs[]; // "Previous Operating System on C:"
  418. extern CHAR __far DntBootIniLine[]; // "Windows NT 3.5 Installation/Upgrade"
  419. extern CHAR __far DntEmptyString[]; // ""
  420. extern CHAR __far DntStandardHeader[];
  421. extern CHAR __far DntPersonalHeader[];
  422. extern CHAR __far DntServerHeader[];
  423. extern CHAR __far DntWorkstationHeader[];
  424. extern CHAR DntParsingArgs[]; // "Parsing arguments..."
  425. extern CHAR __far DntEnterEqualsExit[];
  426. extern CHAR __far DntEnterEqualsRetry[];
  427. extern CHAR __far DntEscEqualsSkipFile[];
  428. extern CHAR __far DntEnterEqualsContinue[];
  429. extern CHAR __far DntPressEnterToExit[];
  430. extern CHAR __far DntF3EqualsExit[]; // "F3=Exit"
  431. extern CHAR __far DntReadingInf[]; // "Reading INF file..."
  432. extern CHAR __far DntCopying[]; // "� Copying: "
  433. extern CHAR __far DntVerifying[]; // "� Verifying: "
  434. extern CHAR DntCheckingDiskSpace[]; // "Checking disk space..."
  435. extern CHAR __far DntConfiguringFloppy[]; // "Configuring floppy disk..."
  436. extern CHAR __far DntWritingData[]; // "Writing Setup parameters...";
  437. extern CHAR __far DntPreparingData[]; // "Determining Setup parameters...";
  438. extern CHAR __far DntFlushingData[]; // "Ensuring disk consistency..."
  439. extern CHAR __far DntInspectingComputer[]; // "Inspecting computer..."
  440. extern CHAR __far DntOpeningInfFile[]; // "Opening INF file..."
  441. extern CHAR __far DntRemovingFile[]; // "Removing file %s"
  442. extern CHAR DntXEqualsRemoveFiles[]; // "X=Remove files"
  443. extern CHAR __far DntXEqualsSkipFile[]; // "X=Skip File"
  444. extern ULONG DniAccelRemove1,DniAccelRemove2;
  445. extern ULONG DniAccelSkip1,DniAccelSkip2;
  446. extern PCHAR __far DntUsage[];
  447. extern PCHAR __far DntUsageNoSlashD[];
  448. //
  449. // Screens
  450. //
  451. extern SCREEN DnsOutOfMemory;
  452. extern SCREEN DnsAccessibilityOptions; // choose accessibility utilities
  453. extern SCREEN DnsNoShareGiven; // user did not give a sharepoint
  454. extern SCREEN DnsBadSource; // user specified a bad source
  455. extern SCREEN DnsBadInf; // inf file is bad or couldn't read it
  456. extern SCREEN DnsBadLocalSrcDrive; // local source drive on cmd line is bad
  457. extern SCREEN DnsNoLocalSrcDrives; // no drives suitable for local source
  458. extern SCREEN DnsNoSpaceOnSyspart; // not enough space for floppyless operation
  459. extern SCREEN DnsCantCreateDir; // couldn't create directory.
  460. extern SCREEN DnsBadInfSection; // inf section is bad
  461. extern SCREEN DnsCopyError; // error copying a file
  462. extern SCREEN DnsVerifyError; // copy of file didn't match original
  463. extern SCREEN DnsWaitCopying; // wait while setup copies files...
  464. extern SCREEN DnsWaitCopyFlop; // wait while setup copies files...
  465. extern SCREEN DnsWaitCleanup; // wait while setup cleans up...
  466. extern SCREEN DnsNeedFloppyDisk0_0; // prompt user to insert a blank floppy
  467. extern SCREEN DnsNeedSFloppyDsk0_0; // prompt user to insert a blank floppy
  468. extern SCREEN DnsNeedFloppyDisk1_0; // prompt user to insert a blank floppy
  469. extern SCREEN DnsNeedFloppyDisk2_0; // prompt user to insert a blank floppy
  470. extern SCREEN DnsNeedFloppyDisk3_0; // prompt user to insert a blank floppy
  471. extern SCREEN DnsNeedFloppyDisk3_1; // prompt user to insert a blank floppy
  472. extern SCREEN DnsNeedSFloppyDsk1_0; // prompt user to insert a blank floppy
  473. extern SCREEN DnsNeedSFloppyDsk2_0; // prompt user to insert a blank floppy
  474. extern SCREEN DnsNeedSFloppyDsk3_0; // prompt user to insert a blank floppy
  475. extern SCREEN DnsNeedSFloppyDsk3_1; // prompt user to insert a blank floppy
  476. extern SCREEN DnsFloppyNotFormatted;// floppy appears to not be formatted
  477. extern SCREEN DnsFloppyCantGetSpace;// can't determine free space on the floppy
  478. extern SCREEN DnsFloppyNotBlank; // not enough free space on the floppy
  479. extern SCREEN DnsFloppyWriteBS; // couldn't write floppy's boot sector
  480. extern SCREEN DnsFloppyVerifyBS; // readback of sector 0 failed or no match
  481. extern SCREEN DnsFloppyBadFormat; // sanity check of bpb failed
  482. extern SCREEN DnsCantWriteFloppy; // couldn't append to txtsetup.inf
  483. extern SCREEN DnsExitDialog; // exit confirmation
  484. extern SCREEN DnsAboutToRebootS; // about to reboot machine (server)
  485. extern SCREEN DnsAboutToRebootW; // about to reboot machine (workstation)
  486. extern SCREEN DnsAboutToRebootX; // about to reboot machine (floppyless)
  487. extern SCREEN DnsAboutToExitS; // about to exit winnt (server)
  488. extern SCREEN DnsAboutToExitW; // about to exit winnt (workstation)
  489. extern SCREEN DnsAboutToExitX; // about to exit winnt (floppyless)
  490. extern SCREEN DnsConfirmRemoveNt; // confirm remove nt files
  491. extern SCREEN DnsCantOpenLogFile; // Can't open setup.log
  492. extern SCREEN DnsLogFileCorrupt; // Log file missing [Repair.WinntFiles]
  493. extern SCREEN DnsRemovingNtFiles; // removing windows nt files.
  494. extern SCREEN DnsSureSkipFile; // confirm skip file on copy error.
  495. extern SCREEN DnsGauge; // gas gauge
  496. extern SCREEN DnsBadDosVersion; // DOS version < 3.0
  497. extern SCREEN DnsRequiresFloppy; // no 1.2 meg or greater floppy at a:
  498. extern SCREEN DnsRequires486; // not 80486 or greater
  499. extern SCREEN DnsNotEnoughMemory; // insufficient memory
  500. extern SCREEN DnsCantRunOnNt; // can't run on windows nt
  501. extern SCREEN DnsNtBootSect; // error installing NT Boot sector, etc.
  502. extern SCREEN DnsOpenReadScript; // can't open/read script file.
  503. extern SCREEN DnsParseScriptFile; // can't parse unattended script file
  504. extern SCREEN DnsBootMsgsTooLarge;
  505. extern SCREEN DnsNoSwapDrive; // can't find a drive for INF swap file
  506. extern SCREEN DnsNoSmartdrv; // SMARTDRV is not installed
  507. #if NEC_98
  508. extern SCREEN FormatError; // 256 Sector Error for FDLess Setup.
  509. #endif //NEC_98
  510. //
  511. // Boot code messages. These go in the fat and fat32 boot sectors.
  512. //
  513. extern CHAR __far BootMsgNtldrIsMissing[];
  514. extern CHAR __far BootMsgDiskError[];
  515. extern CHAR __far BootMsgPressKey[];
  516. #if NEC_98
  517. #else
  518. BOOLEAN
  519. PatchMessagesIntoBootCode(
  520. VOID
  521. );
  522. #endif
  523. //
  524. // Line number within the DnsReadBootcodeFile message where we will
  525. // print the filename.
  526. //
  527. #define BOOTCODE_FILENAME_LINE 2
  528. //
  529. // coords for edit field for entering source path when none was
  530. // specified on cmd line. Keep in sync with DnsNoShareGiven.
  531. //
  532. #define NO_SHARE_X 8
  533. #define NO_SHARE_Y 8
  534. #define NO_SHARE_W 64
  535. #define BAD_SHARE_Y 10 // sync with DnsBadSource
  536. //
  537. // Keep this in sync with DnsBadInfSection
  538. //
  539. #define BAD_SECTION_LINE 0
  540. //
  541. // Keep these in sync with DnsGauge
  542. //
  543. #define GAUGE_WIDTH 50
  544. #define GAUGE_THERM_X 15
  545. #define GAUGE_THERM_Y 19
  546. #define GAUGE_PERCENT_X 39
  547. #define GAUGE_PERCENT_Y 17
  548. //
  549. // Keep in sync with DntTimeUntilShutdown, DnsAboutToReboot
  550. //
  551. #define SHUTDOWNTIME_X 23
  552. #define SHUTDOWNTIME_Y 15
  553. //
  554. // Keep these in sync with DnsNotEnoughMemory
  555. //
  556. #define NOMEM_LINE1 3
  557. #define NOMEM_LINE2 4
  558. //
  559. // Keep in syns with DnsCopyError, DnsVerifyError
  560. //
  561. #define COPYERR_LINE 2
  562. #define VERIFYERR_LINE 4
  563. //
  564. // The max number of optional directories that can be
  565. // specified
  566. //
  567. #define MAX_OPTIONALDIRS 1024
  568. #define MAX_OEMBOOTFILES 1024
  569. #define OPTDIR_TEMPONLY 0x00000001
  570. #define OPTDIR_OEMSYS 0x00000002
  571. #define OPTDIR_OEMOPT 0x00000004
  572. #define OPTDIR_PLATFORM_INDEP 0x00000008
  573. extern unsigned OptionalDirCount; // The number of Optional Directories
  574. extern CHAR *OptionalDirs[MAX_OPTIONALDIRS]; // Pointer to Dir strings
  575. extern unsigned OptionalDirFlags[MAX_OPTIONALDIRS]; // Flags for each Dir
  576. extern unsigned OptionalDirFileCount; // How many files in optional dirs?
  577. extern unsigned OemBootFilesCount; // The number of OEM boot files
  578. extern CHAR *OemBootFiles[MAX_OEMBOOTFILES]; // Pointer to OEM boot filenames
  579. extern PCHAR CmdToExecuteAtEndOfGui;
  580. // slight overestimate, actually 66, but does that include terminal nul?
  581. // 128 is a popular number in the source
  582. #define DOS_MAX_PATH 70
  583. //
  584. // Logging stuff
  585. //
  586. #define LOGGING
  587. #ifdef LOGGING
  588. VOID
  589. __LOG(
  590. IN PCHAR FormatString,
  591. ...
  592. );
  593. #define _LOG(x) __LOG x
  594. #else
  595. #define _LOG(x)
  596. #endif // def LOGGING
  597. extern SPACE_REQUIREMENT __far SpaceRequirements[];
  598. int snprintf( char* target, size_t bufsize, const char *format, ... );
  599. int vsnprintf( char* target, size_t bufsize, const char *format, va_list val );