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.

1129 lines
38 KiB

  1. #define _NTAPI_ULIB_
  2. #include "ulib.hxx"
  3. #if defined(FE_SB) && defined(_X86_)
  4. #include "machine.hxx"
  5. #endif
  6. #include "error.hxx"
  7. #include "drive.hxx"
  8. #include "arg.hxx"
  9. #include "array.hxx"
  10. #include "smsg.hxx"
  11. #include "rtmsg.h"
  12. #include "system.hxx"
  13. #include "ifssys.hxx"
  14. #include "ulibcl.hxx"
  15. #include "ifsentry.hxx"
  16. #include "path.hxx"
  17. #include "parse.hxx"
  18. extern "C" {
  19. #include "nturtl.h"
  20. }
  21. BOOLEAN
  22. ParseArguments(
  23. IN OUT PMESSAGE Message,
  24. OUT PMEDIA_TYPE MediaType,
  25. OUT PWSTRING DosDriveName,
  26. OUT PWSTRING DisplayDriveName,
  27. OUT PWSTRING Label,
  28. OUT PBOOLEAN IsLabelSpeced,
  29. OUT PWSTRING FileSystemName,
  30. OUT PBOOLEAN QuickFormat,
  31. OUT PBOOLEAN ForceMode,
  32. OUT PULONG ClusterSize,
  33. OUT PBOOLEAN Compress,
  34. OUT PBOOLEAN NoPrompts,
  35. OUT PBOOLEAN ForceDismount,
  36. OUT PINT ErrorLevel
  37. )
  38. {
  39. PWSTRING pwstring;
  40. BOOLEAN req160;
  41. BOOLEAN req180;
  42. BOOLEAN req320;
  43. BOOLEAN req360;
  44. BOOLEAN req720;
  45. BOOLEAN req1200;
  46. BOOLEAN req1440;
  47. BOOLEAN req2880;
  48. BOOLEAN req20800;
  49. #if defined(FE_SB) && defined(_X86_)
  50. BOOLEAN req256 = FALSE;
  51. BOOLEAN req640 = FALSE;
  52. BOOLEAN req1232 = FALSE;
  53. #endif
  54. DSTRING tmp_string;
  55. ULONG v;
  56. ARGUMENT_LEXEMIZER arglex;
  57. ARRAY lex_array;
  58. ARRAY arg_array;
  59. PSTRING_ARGUMENT progname = NULL;
  60. PFLAG_ARGUMENT dummyv = NULL;
  61. PFLAG_ARGUMENT dummyu = NULL;
  62. PPATH_ARGUMENT drive = NULL;
  63. PFLAG_ARGUMENT quick = NULL;
  64. PFLAG_ARGUMENT compress = NULL;
  65. PFLAG_ARGUMENT force = NULL; // dangerous option not to be documented
  66. PFLAG_ARGUMENT null_label = NULL;
  67. PSTRING_ARGUMENT label = NULL;
  68. PFLAG_ARGUMENT f160 = NULL;
  69. PFLAG_ARGUMENT f160k = NULL;
  70. PFLAG_ARGUMENT f160kb = NULL;
  71. PFLAG_ARGUMENT f180 = NULL;
  72. PFLAG_ARGUMENT f180k = NULL;
  73. PFLAG_ARGUMENT f180kb = NULL;
  74. PFLAG_ARGUMENT f320 = NULL;
  75. PFLAG_ARGUMENT f320k = NULL;
  76. PFLAG_ARGUMENT f320kb = NULL;
  77. PFLAG_ARGUMENT f360 = NULL;
  78. PFLAG_ARGUMENT f360k = NULL;
  79. PFLAG_ARGUMENT f360kb = NULL;
  80. #if defined(FE_SB) && defined(_X86_)
  81. PFLAG_ARGUMENT f256 = NULL;
  82. PFLAG_ARGUMENT f256k = NULL;
  83. PFLAG_ARGUMENT f256kb = NULL;
  84. #endif
  85. PFLAG_ARGUMENT f720 = NULL;
  86. PFLAG_ARGUMENT f720k = NULL;
  87. PFLAG_ARGUMENT f720kb = NULL;
  88. PFLAG_ARGUMENT f1200 = NULL;
  89. PFLAG_ARGUMENT f1200k = NULL;
  90. PFLAG_ARGUMENT f1200kb = NULL;
  91. PFLAG_ARGUMENT f12 = NULL;
  92. PFLAG_ARGUMENT f12m = NULL;
  93. PFLAG_ARGUMENT f12mb = NULL;
  94. #if defined(FE_SB) && defined(_X86_)
  95. PFLAG_ARGUMENT f1250 = NULL;
  96. PFLAG_ARGUMENT f1250k = NULL;
  97. PFLAG_ARGUMENT f1250kb = NULL;
  98. PFLAG_ARGUMENT f125 = NULL;
  99. PFLAG_ARGUMENT f125m = NULL;
  100. PFLAG_ARGUMENT f125mb = NULL;
  101. PFLAG_ARGUMENT f1 = NULL;
  102. PFLAG_ARGUMENT f1m = NULL;
  103. PFLAG_ARGUMENT f1mb = NULL;
  104. #endif
  105. PFLAG_ARGUMENT f1440 = NULL;
  106. PFLAG_ARGUMENT f1440k = NULL;
  107. PFLAG_ARGUMENT f1440kb = NULL;
  108. PFLAG_ARGUMENT f144 = NULL;
  109. PFLAG_ARGUMENT f144m = NULL;
  110. PFLAG_ARGUMENT f144mb = NULL;
  111. PFLAG_ARGUMENT f2880 = NULL;
  112. PFLAG_ARGUMENT f2880k = NULL;
  113. PFLAG_ARGUMENT f2880kb = NULL;
  114. PFLAG_ARGUMENT f288 = NULL;
  115. PFLAG_ARGUMENT f288m = NULL;
  116. PFLAG_ARGUMENT f288mb = NULL;
  117. PFLAG_ARGUMENT f208 = NULL;
  118. PFLAG_ARGUMENT f208m = NULL;
  119. PFLAG_ARGUMENT f208mb = NULL;
  120. #if defined(FE_SB) && defined(_X86_)
  121. PFLAG_ARGUMENT f640 = NULL;
  122. PFLAG_ARGUMENT f640k = NULL;
  123. PFLAG_ARGUMENT f640kb = NULL;
  124. PFLAG_ARGUMENT f1232 = NULL;
  125. PFLAG_ARGUMENT f1232k = NULL;
  126. PFLAG_ARGUMENT f1232kb = NULL;
  127. PFLAG_ARGUMENT f123 = NULL;
  128. PFLAG_ARGUMENT f123m = NULL;
  129. PFLAG_ARGUMENT f123mb = NULL;
  130. #endif
  131. PFLAG_ARGUMENT cs512 = NULL;
  132. PFLAG_ARGUMENT cs1024 = NULL;
  133. PFLAG_ARGUMENT cs2048 = NULL;
  134. PFLAG_ARGUMENT cs4096 = NULL;
  135. PFLAG_ARGUMENT cs8192 = NULL;
  136. PFLAG_ARGUMENT cs16k = NULL;
  137. PFLAG_ARGUMENT cs32k = NULL;
  138. PFLAG_ARGUMENT cs64k = NULL;
  139. PFLAG_ARGUMENT cs128k = NULL;
  140. PFLAG_ARGUMENT cs256k = NULL;
  141. PFLAG_ARGUMENT one = NULL;
  142. PFLAG_ARGUMENT four = NULL;
  143. PFLAG_ARGUMENT eight = NULL;
  144. PLONG_ARGUMENT secpertrack = NULL;
  145. PLONG_ARGUMENT numtracks = NULL;
  146. PSTRING_ARGUMENT arg_fs_name = NULL;
  147. PFLAG_ARGUMENT helparg = NULL;
  148. PFLAG_ARGUMENT no_prompts = NULL; // dangerous option not to be documented
  149. PFLAG_ARGUMENT yes = NULL; // dangerous option not to be documented
  150. PFLAG_ARGUMENT force_dismount = NULL;
  151. DebugAssert(Message);
  152. DebugAssert(MediaType);
  153. DebugAssert(DosDriveName);
  154. DebugAssert(DisplayDriveName);
  155. DebugAssert(Label);
  156. DebugAssert(FileSystemName);
  157. DebugAssert(QuickFormat);
  158. DebugAssert(ErrorLevel);
  159. DebugAssert(NoPrompts);
  160. DebugAssert(ForceDismount);
  161. #if defined(FE_SB) && defined(_X86_)
  162. // FMR is surpport 640KB&2HD, non surpport 2D Media.
  163. // NT format is compatible for DOS format.
  164. if( IsFMR_N() ) {
  165. if (!(progname = NEW STRING_ARGUMENT) ||
  166. !(dummyv = NEW FLAG_ARGUMENT) ||
  167. !(dummyu = NEW FLAG_ARGUMENT) ||
  168. !(drive = NEW PATH_ARGUMENT) ||
  169. !(quick = NEW FLAG_ARGUMENT) ||
  170. !(compress = NEW FLAG_ARGUMENT) ||
  171. !(force = NEW FLAG_ARGUMENT) ||
  172. !(null_label = NEW FLAG_ARGUMENT) ||
  173. !(no_prompts = NEW FLAG_ARGUMENT) ||
  174. !(yes = NEW FLAG_ARGUMENT) ||
  175. !(force_dismount = NEW FLAG_ARGUMENT) ||
  176. !(label = NEW STRING_ARGUMENT) ||
  177. !(f640 = NEW FLAG_ARGUMENT) ||
  178. !(f640k = NEW FLAG_ARGUMENT) ||
  179. !(f640kb = NEW FLAG_ARGUMENT) ||
  180. !(f720 = NEW FLAG_ARGUMENT) ||
  181. !(f720k = NEW FLAG_ARGUMENT) ||
  182. !(f720kb = NEW FLAG_ARGUMENT) ||
  183. !(f1200 = NEW FLAG_ARGUMENT) ||
  184. !(f1200k = NEW FLAG_ARGUMENT) ||
  185. !(f1200kb = NEW FLAG_ARGUMENT) ||
  186. // Add the 2HD_check on to the ParseArguments()
  187. !(f1232 = NEW FLAG_ARGUMENT) ||
  188. !(f1232k = NEW FLAG_ARGUMENT) ||
  189. !(f1232kb = NEW FLAG_ARGUMENT) ||
  190. !(f12 = NEW FLAG_ARGUMENT) ||
  191. !(f12m = NEW FLAG_ARGUMENT) ||
  192. !(f12mb = NEW FLAG_ARGUMENT) ||
  193. // Add the 2HD_check on to the ParseArguments()
  194. !(f123 = NEW FLAG_ARGUMENT) ||
  195. !(f123m = NEW FLAG_ARGUMENT) ||
  196. !(f123mb = NEW FLAG_ARGUMENT) ||
  197. !(f1440 = NEW FLAG_ARGUMENT) ||
  198. !(f1440k = NEW FLAG_ARGUMENT) ||
  199. !(f1440kb = NEW FLAG_ARGUMENT) ||
  200. !(f144 = NEW FLAG_ARGUMENT) ||
  201. !(f144m = NEW FLAG_ARGUMENT) ||
  202. !(f144mb = NEW FLAG_ARGUMENT) ||
  203. !(f2880 = NEW FLAG_ARGUMENT) ||
  204. !(f2880k = NEW FLAG_ARGUMENT) ||
  205. !(f2880kb = NEW FLAG_ARGUMENT) ||
  206. !(f288 = NEW FLAG_ARGUMENT) ||
  207. !(f288m = NEW FLAG_ARGUMENT) ||
  208. !(f288mb = NEW FLAG_ARGUMENT) ||
  209. !(f208 = NEW FLAG_ARGUMENT)) {
  210. *ErrorLevel = 4;
  211. return FALSE;
  212. }
  213. } else if(IsPC98_N()) {
  214. if (!(progname = NEW STRING_ARGUMENT) ||
  215. !(dummyv = NEW FLAG_ARGUMENT) ||
  216. !(dummyu = NEW FLAG_ARGUMENT) ||
  217. !(drive = NEW PATH_ARGUMENT) ||
  218. !(quick = NEW FLAG_ARGUMENT) ||
  219. !(compress = NEW FLAG_ARGUMENT) ||
  220. !(force = NEW FLAG_ARGUMENT) ||
  221. !(null_label = NEW FLAG_ARGUMENT) ||
  222. !(no_prompts = NEW FLAG_ARGUMENT) ||
  223. !(yes = NEW FLAG_ARGUMENT) ||
  224. !(force_dismount = NEW FLAG_ARGUMENT) ||
  225. !(label = NEW STRING_ARGUMENT) ||
  226. !(f160 = NEW FLAG_ARGUMENT) ||
  227. !(f160k = NEW FLAG_ARGUMENT) ||
  228. !(f160kb = NEW FLAG_ARGUMENT) ||
  229. !(f180 = NEW FLAG_ARGUMENT) ||
  230. !(f180k = NEW FLAG_ARGUMENT) ||
  231. !(f180kb = NEW FLAG_ARGUMENT) ||
  232. !(f256 = NEW FLAG_ARGUMENT) ||
  233. !(f256k = NEW FLAG_ARGUMENT) ||
  234. !(f256kb = NEW FLAG_ARGUMENT) ||
  235. !(f320 = NEW FLAG_ARGUMENT) ||
  236. !(f320k = NEW FLAG_ARGUMENT) ||
  237. !(f320kb = NEW FLAG_ARGUMENT) ||
  238. !(f360 = NEW FLAG_ARGUMENT) ||
  239. !(f360k = NEW FLAG_ARGUMENT) ||
  240. !(f360kb = NEW FLAG_ARGUMENT) ||
  241. !(f640 = NEW FLAG_ARGUMENT) ||
  242. !(f640k = NEW FLAG_ARGUMENT) ||
  243. !(f640kb = NEW FLAG_ARGUMENT) ||
  244. !(f1232 = NEW FLAG_ARGUMENT) ||
  245. !(f1232k = NEW FLAG_ARGUMENT) ||
  246. !(f1232kb = NEW FLAG_ARGUMENT) ||
  247. !(f123 = NEW FLAG_ARGUMENT) ||
  248. !(f123m = NEW FLAG_ARGUMENT) ||
  249. !(f123mb = NEW FLAG_ARGUMENT) ||
  250. !(f720 = NEW FLAG_ARGUMENT) ||
  251. !(f720k = NEW FLAG_ARGUMENT) ||
  252. !(f720kb = NEW FLAG_ARGUMENT) ||
  253. !(f1200 = NEW FLAG_ARGUMENT) ||
  254. !(f1200k = NEW FLAG_ARGUMENT) ||
  255. !(f1200kb = NEW FLAG_ARGUMENT) ||
  256. !(f12 = NEW FLAG_ARGUMENT) ||
  257. !(f12m = NEW FLAG_ARGUMENT) ||
  258. !(f12mb = NEW FLAG_ARGUMENT) ||
  259. !(f1250 = NEW FLAG_ARGUMENT) ||
  260. !(f1250k = NEW FLAG_ARGUMENT) ||
  261. !(f1250kb = NEW FLAG_ARGUMENT) ||
  262. !(f125 = NEW FLAG_ARGUMENT) ||
  263. !(f125m = NEW FLAG_ARGUMENT) ||
  264. !(f125mb = NEW FLAG_ARGUMENT) ||
  265. !(f1 = NEW FLAG_ARGUMENT) ||
  266. !(f1m = NEW FLAG_ARGUMENT) ||
  267. !(f1mb = NEW FLAG_ARGUMENT) ||
  268. !(f1440 = NEW FLAG_ARGUMENT) ||
  269. !(f1440k = NEW FLAG_ARGUMENT) ||
  270. !(f1440kb = NEW FLAG_ARGUMENT) ||
  271. !(f144 = NEW FLAG_ARGUMENT) ||
  272. !(f144m = NEW FLAG_ARGUMENT) ||
  273. !(f144mb = NEW FLAG_ARGUMENT) ||
  274. !(f2880 = NEW FLAG_ARGUMENT) ||
  275. !(f2880k = NEW FLAG_ARGUMENT) ||
  276. !(f2880kb = NEW FLAG_ARGUMENT) ||
  277. !(f288 = NEW FLAG_ARGUMENT) ||
  278. !(f288m = NEW FLAG_ARGUMENT) ||
  279. !(f288mb = NEW FLAG_ARGUMENT) ||
  280. !(f208 = NEW FLAG_ARGUMENT)) {
  281. *ErrorLevel = 4;
  282. return FALSE;
  283. }
  284. }else
  285. #endif
  286. if (!(progname = NEW STRING_ARGUMENT) ||
  287. !(dummyv = NEW FLAG_ARGUMENT) ||
  288. !(dummyu = NEW FLAG_ARGUMENT) ||
  289. !(drive = NEW PATH_ARGUMENT) ||
  290. !(quick = NEW FLAG_ARGUMENT) ||
  291. !(compress = NEW FLAG_ARGUMENT) ||
  292. !(force = NEW FLAG_ARGUMENT) ||
  293. !(null_label = NEW FLAG_ARGUMENT) ||
  294. !(no_prompts = NEW FLAG_ARGUMENT) ||
  295. !(yes = NEW FLAG_ARGUMENT) ||
  296. !(force_dismount = NEW FLAG_ARGUMENT) ||
  297. !(label = NEW STRING_ARGUMENT) ||
  298. !(f160 = NEW FLAG_ARGUMENT) ||
  299. !(f160k = NEW FLAG_ARGUMENT) ||
  300. !(f160kb = NEW FLAG_ARGUMENT) ||
  301. !(f180 = NEW FLAG_ARGUMENT) ||
  302. !(f180k = NEW FLAG_ARGUMENT) ||
  303. !(f180kb = NEW FLAG_ARGUMENT) ||
  304. !(f320 = NEW FLAG_ARGUMENT) ||
  305. !(f320k = NEW FLAG_ARGUMENT) ||
  306. !(f320kb = NEW FLAG_ARGUMENT) ||
  307. !(f360 = NEW FLAG_ARGUMENT) ||
  308. !(f360k = NEW FLAG_ARGUMENT) ||
  309. !(f360kb = NEW FLAG_ARGUMENT) ||
  310. #if defined(FE_SB) && defined(_X86_)
  311. // FMR Jul.13.1994 SFT KMR
  312. // 3mode PC/AT surpports 640KB&2HD Media.
  313. // NT format is compatible for DOS format.
  314. !(f640 = NEW FLAG_ARGUMENT) ||
  315. !(f640k = NEW FLAG_ARGUMENT) ||
  316. !(f640kb = NEW FLAG_ARGUMENT) ||
  317. !(f1232 = NEW FLAG_ARGUMENT) ||
  318. !(f1232k = NEW FLAG_ARGUMENT) ||
  319. !(f1232kb = NEW FLAG_ARGUMENT) ||
  320. !(f123 = NEW FLAG_ARGUMENT) ||
  321. !(f123m = NEW FLAG_ARGUMENT) ||
  322. !(f123mb = NEW FLAG_ARGUMENT) ||
  323. #endif
  324. !(f720 = NEW FLAG_ARGUMENT) ||
  325. !(f720k = NEW FLAG_ARGUMENT) ||
  326. !(f720kb = NEW FLAG_ARGUMENT) ||
  327. !(f1200 = NEW FLAG_ARGUMENT) ||
  328. !(f1200k = NEW FLAG_ARGUMENT) ||
  329. !(f1200kb = NEW FLAG_ARGUMENT) ||
  330. !(f12 = NEW FLAG_ARGUMENT) ||
  331. !(f12m = NEW FLAG_ARGUMENT) ||
  332. !(f12mb = NEW FLAG_ARGUMENT) ||
  333. !(f1440 = NEW FLAG_ARGUMENT) ||
  334. !(f1440k = NEW FLAG_ARGUMENT) ||
  335. !(f1440kb = NEW FLAG_ARGUMENT) ||
  336. !(f144 = NEW FLAG_ARGUMENT) ||
  337. !(f144m = NEW FLAG_ARGUMENT) ||
  338. !(f144mb = NEW FLAG_ARGUMENT) ||
  339. !(f2880 = NEW FLAG_ARGUMENT) ||
  340. !(f2880k = NEW FLAG_ARGUMENT) ||
  341. !(f2880kb = NEW FLAG_ARGUMENT) ||
  342. !(f288 = NEW FLAG_ARGUMENT) ||
  343. !(f288m = NEW FLAG_ARGUMENT) ||
  344. !(f288mb = NEW FLAG_ARGUMENT) ||
  345. !(f208 = NEW FLAG_ARGUMENT)) {
  346. *ErrorLevel = 4;
  347. return FALSE;
  348. }
  349. if (!(f208m = NEW FLAG_ARGUMENT) ||
  350. !(f208mb = NEW FLAG_ARGUMENT) ||
  351. !(cs512 = NEW FLAG_ARGUMENT) ||
  352. !(cs1024 = NEW FLAG_ARGUMENT) ||
  353. !(cs2048 = NEW FLAG_ARGUMENT) ||
  354. !(cs4096 = NEW FLAG_ARGUMENT) ||
  355. !(cs8192 = NEW FLAG_ARGUMENT) ||
  356. !(cs16k = NEW FLAG_ARGUMENT) ||
  357. !(cs32k = NEW FLAG_ARGUMENT) ||
  358. !(cs64k = NEW FLAG_ARGUMENT) ||
  359. !(cs128k = NEW FLAG_ARGUMENT) ||
  360. !(cs256k = NEW FLAG_ARGUMENT) ||
  361. !(one = NEW FLAG_ARGUMENT) ||
  362. !(four = NEW FLAG_ARGUMENT) ||
  363. !(eight = NEW FLAG_ARGUMENT) ||
  364. !(secpertrack = NEW LONG_ARGUMENT) ||
  365. !(numtracks = NEW LONG_ARGUMENT) ||
  366. !(arg_fs_name = NEW STRING_ARGUMENT) ||
  367. !(helparg = NEW FLAG_ARGUMENT)) {
  368. *ErrorLevel = 4;
  369. return FALSE;
  370. }
  371. if (!lex_array.Initialize() ||
  372. !arg_array.Initialize() ||
  373. !arglex.Initialize(&lex_array)) {
  374. *ErrorLevel = 4;
  375. return FALSE;
  376. }
  377. arglex.SetCaseSensitive(FALSE);
  378. if (!arglex.PrepareToParse()) {
  379. *ErrorLevel = 4;
  380. return FALSE;
  381. }
  382. #if defined(FE_SB) && defined(_X86_)
  383. // FMR Jul.13.1994 SFT KMR
  384. // FMR is surpport 640KB&2HD, non surpport 2D Media.
  385. // NT format is compatible for DOS format.
  386. if ( IsFMR_N() ) {
  387. if (!progname->Initialize("*") ||
  388. !dummyv->Initialize("/v") ||
  389. !dummyu->Initialize("/u") ||
  390. !drive->Initialize("*") ||
  391. !quick->Initialize("/q") ||
  392. !compress->Initialize("/c") ||
  393. !force->Initialize("/force") ||
  394. !null_label->Initialize("/v:\"\"") ||
  395. !label->Initialize("/v:*") ||
  396. !no_prompts->Initialize("/backup") ||
  397. !yes->Initialize("/y") ||
  398. !force_dismount->Initialize("/x") ||
  399. !f640->Initialize("/f:640") ||
  400. !f640k->Initialize("/f:640K") ||
  401. !f640kb->Initialize("/f:640KB") ||
  402. !f720->Initialize("/f:720") ||
  403. !f720k->Initialize("/f:720K") ||
  404. !f720kb->Initialize("/f:720KB") ||
  405. !f1200->Initialize("/f:1200") ||
  406. !f1200k->Initialize("/f:1200K") ||
  407. !f1200kb->Initialize("/f:1200KB") ||
  408. // Add the 2HD_check on to the ParseArguments()
  409. !f1232->Initialize("/f:1232") ||
  410. !f1232k->Initialize("/f:1232K") ||
  411. !f1232kb->Initialize("/f:1232KB") ||
  412. !f12->Initialize("/f:1.2") ||
  413. !f12m->Initialize("/f:1.2M") ||
  414. !f12mb->Initialize("/f:1.2MB") ||
  415. // Add the 2HD_check on to the ParseArguments()
  416. !f123->Initialize("/f:1.23") ||
  417. !f123m->Initialize("/f:1.23M") ||
  418. !f123mb->Initialize("/f:1.23MB") ||
  419. !f1440->Initialize("/f:1440") ||
  420. !f1440k->Initialize("/f:1440K") ||
  421. !f1440kb->Initialize("/f:1440KB") ||
  422. !f144->Initialize("/f:1.44") ||
  423. !f144m->Initialize("/f:1.44M") ||
  424. !f144mb->Initialize("/f:1.44MB") ||
  425. !f2880->Initialize("/f:2880") ||
  426. !f2880k->Initialize("/f:2880K") ||
  427. !f2880kb->Initialize("/f:2880KB") ||
  428. !f288->Initialize("/f:2.88") ||
  429. !f288m->Initialize("/f:2.88M") ||
  430. !f288mb->Initialize("/f:2.88MB") ||
  431. !f208->Initialize("/f:20.8") ||
  432. !f208m->Initialize("/f:20.8M") ||
  433. !f208mb->Initialize("/f:20.8MB") ||
  434. !cs512->Initialize("/a:512") ||
  435. !cs1024->Initialize("/a:1024") ||
  436. !cs2048->Initialize("/a:2048") ||
  437. !cs4096->Initialize("/a:4096") ||
  438. !cs8192->Initialize("/a:8192") ||
  439. !cs16k->Initialize("/a:16k") ||
  440. !cs32k->Initialize("/a:32k") ||
  441. !cs64k->Initialize("/a:64k") ||
  442. !cs128k->Initialize("/a:128k") ||
  443. !cs256k->Initialize("/a:256k") ||
  444. !one->Initialize("/1") ||
  445. !four->Initialize("/4") ||
  446. !eight->Initialize("/8") ||
  447. !secpertrack->Initialize("/n:*") ||
  448. !numtracks->Initialize("/t:*") ||
  449. !arg_fs_name->Initialize("/fs:*") ||
  450. !helparg->Initialize("/?")) {
  451. *ErrorLevel = 4;
  452. return FALSE;
  453. }
  454. }
  455. else if(IsPC98_N()) {
  456. if (!progname->Initialize("*") ||
  457. !dummyv->Initialize("/v") ||
  458. !dummyu->Initialize("/u") ||
  459. !drive->Initialize("*") ||
  460. !quick->Initialize("/q") ||
  461. !compress->Initialize("/c") ||
  462. !force->Initialize("/force") ||
  463. !null_label->Initialize("/v:\"\"") ||
  464. !label->Initialize("/v:*") ||
  465. !no_prompts->Initialize("/backup") ||
  466. !yes->Initialize("/y") ||
  467. !force_dismount->Initialize("/x") ||
  468. !f160->Initialize("/f:160") ||
  469. !f160k->Initialize("/f:160K") ||
  470. !f160kb->Initialize("/f:160KB") ||
  471. !f180->Initialize("/f:180") ||
  472. !f180k->Initialize("/f:180K") ||
  473. !f180kb->Initialize("/f:180KB") ||
  474. !f256->Initialize("/f:256") ||
  475. !f256k->Initialize("/f:256K") ||
  476. !f256kb->Initialize("/f:256KB") ||
  477. !f320->Initialize("/f:320") ||
  478. !f320k->Initialize("/f:320K") ||
  479. !f320kb->Initialize("/f:320KB") ||
  480. !f360->Initialize("/f:360") ||
  481. !f360k->Initialize("/f:360K") ||
  482. !f360kb->Initialize("/f:360KB") ||
  483. !f640->Initialize("/f:640") ||
  484. !f640k->Initialize("/f:640K") ||
  485. !f640kb->Initialize("/f:640KB") ||
  486. !f720->Initialize("/f:720") ||
  487. !f720k->Initialize("/f:720K") ||
  488. !f720kb->Initialize("/f:720KB") ||
  489. !f1200->Initialize("/f:1200") ||
  490. !f1200k->Initialize("/f:1200K") ||
  491. !f1200kb->Initialize("/f:1200KB") ||
  492. !f12->Initialize("/f:1.2") ||
  493. !f12m->Initialize("/f:1.2M") ||
  494. !f12mb->Initialize("/f:1.2MB") ||
  495. !f1250->Initialize("/f:1250") ||
  496. !f1250k->Initialize("/f:1250K") ||
  497. !f1250kb->Initialize("/f:1250KB") ||
  498. !f125->Initialize("/f:1.25") ||
  499. !f125m->Initialize("/f:1.25M") ||
  500. !f125mb->Initialize("/f:1.25MB") ||
  501. !f1->Initialize("/f:1") ||
  502. !f1m->Initialize("/f:1M") ||
  503. !f1mb->Initialize("/f:1MB") ||
  504. !f1440->Initialize("/f:1440") ||
  505. !f1440k->Initialize("/f:1440K") ||
  506. !f1440kb->Initialize("/f:1440KB") ||
  507. !f144->Initialize("/f:1.44") ||
  508. !f144m->Initialize("/f:1.44M") ||
  509. !f144mb->Initialize("/f:1.44MB") ||
  510. !f2880->Initialize("/f:2880") ||
  511. !f2880k->Initialize("/f:2880K") ||
  512. !f2880kb->Initialize("/f:2880KB") ||
  513. !f288->Initialize("/f:2.88") ||
  514. !f288m->Initialize("/f:2.88M") ||
  515. !f288mb->Initialize("/f:2.88MB") ||
  516. !f208->Initialize("/f:20.8") ||
  517. !f208m->Initialize("/f:20.8M") ||
  518. !f208mb->Initialize("/f:20.8MB") ||
  519. !cs512->Initialize("/a:512") ||
  520. !cs1024->Initialize("/a:1024") ||
  521. !cs2048->Initialize("/a:2048") ||
  522. !cs4096->Initialize("/a:4096") ||
  523. !cs8192->Initialize("/a:8192") ||
  524. !cs16k->Initialize("/a:16k") ||
  525. !cs32k->Initialize("/a:32k") ||
  526. !cs64k->Initialize("/a:64k") ||
  527. !cs128k->Initialize("/a:128k") ||
  528. !cs256k->Initialize("/a:256k") ||
  529. !one->Initialize("/1") ||
  530. !four->Initialize("/4") ||
  531. !eight->Initialize("/8") ||
  532. !secpertrack->Initialize("/n:*") ||
  533. !numtracks->Initialize("/t:*") ||
  534. !arg_fs_name->Initialize("/fs:*") ||
  535. !helparg->Initialize("/?")) {
  536. *ErrorLevel = 4;
  537. return FALSE;
  538. }
  539. }else
  540. #endif
  541. if (!progname->Initialize("*") ||
  542. !dummyv->Initialize("/v") ||
  543. !dummyu->Initialize("/u") ||
  544. !drive->Initialize("*") ||
  545. !quick->Initialize("/q") ||
  546. !compress->Initialize("/c") ||
  547. !force->Initialize("/force") ||
  548. !null_label->Initialize("/v:\"\"") ||
  549. !label->Initialize("/v:*") ||
  550. !no_prompts->Initialize("/backup") ||
  551. !yes->Initialize("/y") ||
  552. !force_dismount->Initialize("/x") ||
  553. !f160->Initialize("/f:160") ||
  554. !f160k->Initialize("/f:160K") ||
  555. !f160kb->Initialize("/f:160KB") ||
  556. !f180->Initialize("/f:180") ||
  557. !f180k->Initialize("/f:180K") ||
  558. !f180kb->Initialize("/f:180KB") ||
  559. !f320->Initialize("/f:320") ||
  560. !f320k->Initialize("/f:320K") ||
  561. !f320kb->Initialize("/f:320KB") ||
  562. !f360->Initialize("/f:360") ||
  563. !f360k->Initialize("/f:360K") ||
  564. !f360kb->Initialize("/f:360KB") ||
  565. #if defined(FE_SB) && defined(_X86_)
  566. // FMR Jul.13.1994 SFT KMR
  567. // 3mode PC/AT surpports 640KB&2HD Media.
  568. // NT format is compatible for DOS format.
  569. !f640->Initialize("/f:640") ||
  570. !f640k->Initialize("/f:640K") ||
  571. !f640kb->Initialize("/f:640KB") ||
  572. !f1232->Initialize("/f:1232") ||
  573. !f1232k->Initialize("/f:1232K") ||
  574. !f1232kb->Initialize("/f:1232KB") ||
  575. !f123->Initialize("/f:1.23") ||
  576. !f123m->Initialize("/f:1.23M") ||
  577. !f123mb->Initialize("/f:1.23MB") ||
  578. #endif
  579. !f720->Initialize("/f:720") ||
  580. !f720k->Initialize("/f:720K") ||
  581. !f720kb->Initialize("/f:720KB") ||
  582. !f1200->Initialize("/f:1200") ||
  583. !f1200k->Initialize("/f:1200K") ||
  584. !f1200kb->Initialize("/f:1200KB") ||
  585. !f12->Initialize("/f:1.2") ||
  586. !f12m->Initialize("/f:1.2M") ||
  587. !f12mb->Initialize("/f:1.2MB") ||
  588. !f1440->Initialize("/f:1440") ||
  589. !f1440k->Initialize("/f:1440K") ||
  590. !f1440kb->Initialize("/f:1440KB") ||
  591. !f144->Initialize("/f:1.44") ||
  592. !f144m->Initialize("/f:1.44M") ||
  593. !f144mb->Initialize("/f:1.44MB") ||
  594. !f2880->Initialize("/f:2880") ||
  595. !f2880k->Initialize("/f:2880K") ||
  596. !f2880kb->Initialize("/f:2880KB") ||
  597. !f288->Initialize("/f:2.88") ||
  598. !f288m->Initialize("/f:2.88M") ||
  599. !f288mb->Initialize("/f:2.88MB") ||
  600. !f208->Initialize("/f:20.8") ||
  601. !f208m->Initialize("/f:20.8M") ||
  602. !f208mb->Initialize("/f:20.8MB") ||
  603. !cs512->Initialize("/a:512") ||
  604. !cs1024->Initialize("/a:1024") ||
  605. !cs2048->Initialize("/a:2048") ||
  606. !cs4096->Initialize("/a:4096") ||
  607. !cs8192->Initialize("/a:8192") ||
  608. !cs16k->Initialize("/a:16k") ||
  609. !cs32k->Initialize("/a:32k") ||
  610. !cs64k->Initialize("/a:64k") ||
  611. !cs128k->Initialize("/a:128k") ||
  612. !cs256k->Initialize("/a:256k") ||
  613. !one->Initialize("/1") ||
  614. !four->Initialize("/4") ||
  615. !eight->Initialize("/8") ||
  616. !secpertrack->Initialize("/n:*") ||
  617. !numtracks->Initialize("/t:*") ||
  618. !arg_fs_name->Initialize("/fs:*") ||
  619. !helparg->Initialize("/?")) {
  620. *ErrorLevel = 4;
  621. return FALSE;
  622. }
  623. if (!arg_array.Put(progname) ||
  624. !arg_array.Put(dummyv) ||
  625. !arg_array.Put(dummyu) ||
  626. !arg_array.Put(drive) ||
  627. !arg_array.Put(quick) ||
  628. !arg_array.Put(compress) ||
  629. !arg_array.Put(force) ||
  630. !arg_array.Put(null_label) ||
  631. !arg_array.Put(label) ||
  632. !arg_array.Put(no_prompts) ||
  633. !arg_array.Put(yes) ||
  634. !arg_array.Put(force_dismount) ||
  635. !arg_array.Put(f1440) ||
  636. !arg_array.Put(f1440k) ||
  637. !arg_array.Put(f1440kb) ||
  638. !arg_array.Put(f144) ||
  639. !arg_array.Put(f144m) ||
  640. !arg_array.Put(f144mb) ||
  641. !arg_array.Put(cs512) ||
  642. !arg_array.Put(cs1024) ||
  643. !arg_array.Put(cs2048) ||
  644. !arg_array.Put(cs4096) ||
  645. !arg_array.Put(cs8192) ||
  646. !arg_array.Put(cs16k) ||
  647. !arg_array.Put(cs32k) ||
  648. !arg_array.Put(cs64k) ||
  649. !arg_array.Put(cs128k) ||
  650. !arg_array.Put(cs256k) ||
  651. !arg_array.Put(secpertrack) ||
  652. !arg_array.Put(numtracks) ||
  653. !arg_array.Put(arg_fs_name) ||
  654. !arg_array.Put(helparg)) {
  655. *ErrorLevel = 4;
  656. return FALSE;
  657. }
  658. if (!arglex.DoParsing(&arg_array)) {
  659. Message->Set(MSG_INVALID_PARAMETER);
  660. Message->Display("%W", pwstring = arglex.QueryInvalidArgument());
  661. DELETE(pwstring);
  662. arg_array.DeleteAllMembers();
  663. *ErrorLevel = 4;
  664. return FALSE;
  665. }
  666. if (helparg->QueryFlag()) {
  667. DisplayFormatUsage(Message);
  668. arg_array.DeleteAllMembers();
  669. *ErrorLevel = 0;
  670. return FALSE;
  671. }
  672. if (drive->IsValueSet()) {
  673. PPATH ppath;
  674. PATH fullpath;
  675. DSTRING drive_path_string;
  676. PATH_ANALYZE_CODE rst;
  677. ppath = drive->GetPath();
  678. #if defined(RUN_ON_NT4)
  679. if (!DosDriveName->Initialize(ppath->GetPathString())) {
  680. DebugPrint("Out of memory.\n");
  681. *ErrorLevel = 1;
  682. return FALSE;
  683. }
  684. #endif
  685. #if !defined(RUN_ON_NT4)
  686. rst = ppath->AnalyzePath(DosDriveName,
  687. &fullpath,
  688. &drive_path_string);
  689. switch (rst) {
  690. case PATH_OK:
  691. case PATH_COULD_BE_FLOPPY:
  692. if (drive_path_string.QueryChCount() != 0) {
  693. Message->Set(MSG_FMT_INVALID_DRIVE_SPEC);
  694. Message->Display();
  695. *ErrorLevel = 1;
  696. return FALSE;
  697. }
  698. if (ppath->IsGuidVolName()) {
  699. if (!DisplayDriveName->Initialize(DosDriveName)) {
  700. DebugPrint("Out of memory.\n");
  701. *ErrorLevel = 1;
  702. return FALSE;
  703. }
  704. } else {
  705. if (!DisplayDriveName->Initialize(fullpath.GetPathString())) {
  706. DebugPrint("Out of memory.\n");
  707. *ErrorLevel = 1;
  708. return FALSE;
  709. }
  710. }
  711. break;
  712. case PATH_OUT_OF_MEMORY:
  713. DebugPrint("Out of memory.\n");
  714. *ErrorLevel = 1;
  715. return FALSE;
  716. case PATH_NO_MOUNT_POINT_FOR_VOLUME_NAME_PATH:
  717. Message->Set(MSG_FMT_NO_MOUNT_POINT_FOR_GUID_VOLNAME_PATH);
  718. Message->Display();
  719. *ErrorLevel = 1;
  720. return FALSE;
  721. default:
  722. Message->Set(MSG_FMT_INVALID_DRIVE_SPEC);
  723. Message->Display();
  724. *ErrorLevel = 1;
  725. return FALSE;
  726. }
  727. #endif
  728. if (!DosDriveName->Strupr()) {
  729. *ErrorLevel = 1;
  730. return FALSE;
  731. }
  732. } else {
  733. Message->Set(MSG_REQUIRED_PARAMETER);
  734. Message->Display("");
  735. arg_array.DeleteAllMembers();
  736. *ErrorLevel = 1;
  737. return FALSE;
  738. }
  739. if (label->IsValueSet() && null_label->QueryFlag()) {
  740. Message->Set(MSG_INVALID_PARAMETER);
  741. Message->Display("%s", "/v:\"\"");
  742. *ErrorLevel = 4;
  743. arg_array.DeleteAllMembers();
  744. return FALSE;
  745. }
  746. *IsLabelSpeced = label->IsValueSet() || null_label->QueryFlag();
  747. if (label->IsValueSet()) {
  748. if (!Label->Initialize(label->GetString())) {
  749. *ErrorLevel = 4;
  750. arg_array.DeleteAllMembers();
  751. return FALSE;
  752. }
  753. } else {
  754. if (!Label->Initialize("")) {
  755. *ErrorLevel = 4;
  756. arg_array.DeleteAllMembers();
  757. return FALSE;
  758. }
  759. }
  760. if (arg_fs_name->IsValueSet()) {
  761. if (!FileSystemName->Initialize(arg_fs_name->GetString()) ||
  762. !FileSystemName->Strupr()) {
  763. *ErrorLevel = 4;
  764. arg_array.DeleteAllMembers();
  765. return FALSE;
  766. }
  767. if (FileSystemName->QueryChCount() == 0) {
  768. Message->Set(MSG_INVALID_PARAMETER);
  769. Message->Display("%W", arg_fs_name->GetLexeme());
  770. *ErrorLevel = 4;
  771. arg_array.DeleteAllMembers();
  772. return FALSE;
  773. }
  774. } else {
  775. if (!FileSystemName->Initialize("")) {
  776. *ErrorLevel = 4;
  777. arg_array.DeleteAllMembers();
  778. return FALSE;
  779. }
  780. }
  781. *NoPrompts = no_prompts->QueryFlag();
  782. *ForceDismount = force_dismount->QueryFlag();
  783. *QuickFormat = quick->QueryFlag();
  784. *ForceMode = force->QueryFlag();
  785. if (yes->QueryFlag()) {
  786. *NoPrompts = *ForceMode = TRUE;
  787. }
  788. *Compress = compress->QueryFlag();
  789. if (label->IsValueSet()) {
  790. if (eight->QueryFlag()) {
  791. Message->Set(MSG_NO_LABEL_WITH_8);
  792. Message->Display("");
  793. *ErrorLevel = 1;
  794. arg_array.DeleteAllMembers();
  795. return FALSE;
  796. }
  797. }
  798. v = 0;
  799. *ClusterSize = 0;
  800. if (cs512->QueryFlag()) {
  801. *ClusterSize = 512;
  802. v++;
  803. }
  804. if (cs1024->QueryFlag()) {
  805. *ClusterSize = 1024;
  806. v++;
  807. }
  808. if (cs2048->QueryFlag()) {
  809. *ClusterSize = 2048;
  810. v++;
  811. }
  812. if (cs4096->QueryFlag()) {
  813. *ClusterSize = 4096;
  814. v++;
  815. }
  816. if (cs8192->QueryFlag()) {
  817. *ClusterSize = 8192;
  818. v++;
  819. }
  820. if (cs16k->QueryFlag()) {
  821. *ClusterSize = 16*1024;
  822. v++;
  823. }
  824. if (cs32k->QueryFlag()) {
  825. *ClusterSize = 32*1024;
  826. v++;
  827. }
  828. if (cs64k->QueryFlag()) {
  829. *ClusterSize = 64*1024;
  830. v++;
  831. }
  832. if (cs128k->QueryFlag()) {
  833. *ClusterSize = 128*1024;
  834. v++;
  835. }
  836. if (cs256k->QueryFlag()) {
  837. *ClusterSize = 256*1024;
  838. v++;
  839. }
  840. if (v > 1) {
  841. Message->Set(MSG_INCOMPATIBLE_PARAMETERS);
  842. Message->Display();
  843. *ErrorLevel = 4;
  844. arg_array.DeleteAllMembers();
  845. return FALSE;
  846. }
  847. // -----------------------
  848. // Compute the media type.
  849. // -----------------------
  850. #if defined(FE_SB) && defined(_X86_)
  851. // FMR Jul.13.1994 SFT KMR
  852. // When /T:80 and /N:8, modify the process to be 640KB's
  853. // Delete the /F:160,180,320 and 360 process from the ParseArguments()
  854. // Not surported media 2D.
  855. // NT format is compatible for DOS format.
  856. if ( IsFMR_N() ) {
  857. req160 = FALSE;
  858. req180 = FALSE;
  859. req320 = FALSE;
  860. req360 = FALSE;
  861. } else {
  862. #endif
  863. req160 = f160->QueryFlag() || f160k->QueryFlag() || f160kb->QueryFlag();
  864. req180 = f180->QueryFlag() || f180k->QueryFlag() || f180kb->QueryFlag();
  865. req320 = f320->QueryFlag() || f320k->QueryFlag() || f320kb->QueryFlag();
  866. req360 = f360->QueryFlag() || f360k->QueryFlag() || f360kb->QueryFlag();
  867. #if defined(FE_SB) && defined(_X86_)
  868. }
  869. if(IsPC98_N()) {
  870. req256 = f256->QueryFlag() || f256k->QueryFlag() || f256kb->QueryFlag();
  871. } else {
  872. req256 = FALSE;
  873. }
  874. // FMR, 3mode PC/AT(FMV) and PC98 uses f640,
  875. // FMR and 3mode PC/AT(FMV) uses f1230,
  876. // PC98 uses f1250.
  877. req640 = f640->QueryFlag() || f640k->QueryFlag() || f640kb->QueryFlag();
  878. if ( IsPC98_N() ) {
  879. req1232 = f1250->QueryFlag() || f1250k->QueryFlag() || f1250kb->QueryFlag() ||
  880. f125->QueryFlag() || f125m->QueryFlag() || f125mb->QueryFlag() ||
  881. f1->QueryFlag() || f1m->QueryFlag() || f1mb->QueryFlag();
  882. } else {
  883. req1232 = f1232->QueryFlag() || f1232k->QueryFlag() || f1232kb->QueryFlag() ||
  884. f123->QueryFlag() || f123m->QueryFlag() || f123mb->QueryFlag();
  885. }
  886. #endif
  887. req720 = f720->QueryFlag() || f720k->QueryFlag() || f720kb->QueryFlag();
  888. req1200 = f1200->QueryFlag() || f1200k->QueryFlag() || f1200kb->QueryFlag() ||
  889. f12->QueryFlag() || f12m->QueryFlag() || f12mb->QueryFlag();
  890. req1440 = f1440->QueryFlag() || f1440k->QueryFlag() || f1440kb->QueryFlag() ||
  891. f144->QueryFlag() || f144m->QueryFlag() || f144mb->QueryFlag();
  892. req2880 = f2880->QueryFlag() || f2880k->QueryFlag() || f2880kb->QueryFlag() ||
  893. f288->QueryFlag() || f288m->QueryFlag() || f288mb->QueryFlag();
  894. req20800 = f208->QueryFlag() || f208m->QueryFlag() || f208mb->QueryFlag();
  895. if (one->QueryFlag() && four->QueryFlag() && !eight->QueryFlag()) {
  896. req180 = TRUE;
  897. } else if (one->QueryFlag() && !four->QueryFlag() && eight->QueryFlag()) {
  898. req160 = TRUE;
  899. } else if (!one->QueryFlag() && four->QueryFlag() && !eight->QueryFlag()) {
  900. req360 = TRUE;
  901. } else if (!one->QueryFlag() && !four->QueryFlag() && eight->QueryFlag()) {
  902. req320 = TRUE;
  903. } else if (!one->QueryFlag() && !four->QueryFlag() && !eight->QueryFlag()) {
  904. } else {
  905. Message->Set(MSG_INCOMPATIBLE_PARAMETERS);
  906. Message->Display("");
  907. *ErrorLevel = 1;
  908. arg_array.DeleteAllMembers();
  909. return FALSE;
  910. }
  911. if (secpertrack->IsValueSet() && numtracks->IsValueSet()) {
  912. if (secpertrack->QueryLong() == 8) {
  913. if (numtracks->QueryLong() == 40) {
  914. req320 = TRUE;
  915. #if defined(FE_SB) && defined(_X86_)
  916. }
  917. else if ( numtracks->QueryLong() == 77) {
  918. // When /T:77 and /N:8, modify the process to be 1.2MB's
  919. req1232 = TRUE;
  920. }
  921. else if ( numtracks->QueryLong() == 80 ) {
  922. // When /T:80 and /N:8, modify the process to be 640KB's
  923. req640 = TRUE;
  924. #endif
  925. } else {
  926. Message->Set(MSG_INCOMPATIBLE_PARAMETERS);
  927. Message->Display("");
  928. *ErrorLevel = 1;
  929. arg_array.DeleteAllMembers();
  930. return FALSE;
  931. }
  932. } else if (secpertrack->QueryLong() == 9) {
  933. if (numtracks->QueryLong() == 40) {
  934. req360 = TRUE;
  935. } else if (numtracks->QueryLong() == 80) {
  936. req720 = TRUE;
  937. } else {
  938. Message->Set(MSG_INCOMPATIBLE_PARAMETERS);
  939. Message->Display("");
  940. *ErrorLevel = 1;
  941. arg_array.DeleteAllMembers();
  942. return FALSE;
  943. }
  944. } else if (secpertrack->QueryLong() == 15) {
  945. if (numtracks->QueryLong() == 80) {
  946. req1200 = TRUE;
  947. } else {
  948. Message->Set(MSG_INCOMPATIBLE_PARAMETERS);
  949. Message->Display("");
  950. *ErrorLevel = 1;
  951. arg_array.DeleteAllMembers();
  952. return FALSE;
  953. }
  954. } else if (secpertrack->QueryLong() == 18) {
  955. if (numtracks->QueryLong() == 80) {
  956. req1440 = TRUE;
  957. } else {
  958. Message->Set(MSG_INCOMPATIBLE_PARAMETERS);
  959. Message->Display("");
  960. *ErrorLevel = 1;
  961. arg_array.DeleteAllMembers();
  962. return FALSE;
  963. }
  964. } else if (secpertrack->QueryLong() == 36) {
  965. if (numtracks->QueryLong() == 80) {
  966. req2880 = TRUE;
  967. } else {
  968. Message->Set(MSG_INCOMPATIBLE_PARAMETERS);
  969. Message->Display("");
  970. *ErrorLevel = 1;
  971. arg_array.DeleteAllMembers();
  972. return FALSE;
  973. }
  974. #if defined(FE_SB) && defined(_X86_)
  975. // NEC98 '94.09.22 NES
  976. } else if(IsPC98_N() && (secpertrack->QueryLong() == 26)) {
  977. req256 = TRUE;
  978. #endif
  979. } else {
  980. Message->Set(MSG_INCOMPATIBLE_PARAMETERS);
  981. Message->Display("");
  982. *ErrorLevel = 1;
  983. arg_array.DeleteAllMembers();
  984. return FALSE;
  985. }
  986. } else if (secpertrack->IsValueSet() || numtracks->IsValueSet()) {
  987. Message->Set(MSG_NEED_BOTH_T_AND_N);
  988. Message->Display("");
  989. *ErrorLevel = 1;
  990. arg_array.DeleteAllMembers();
  991. return FALSE;
  992. }
  993. if (!DetermineMediaType(MediaType, Message, req160, req180, req320,
  994. req360, req720, req1200, req1440, req2880,
  995. req20800
  996. #if defined(FE_SB) && defined(_X86_)
  997. ,req256,req640,req1232
  998. #endif
  999. )
  1000. ) {
  1001. *ErrorLevel = 1;
  1002. arg_array.DeleteAllMembers();
  1003. return FALSE;
  1004. }
  1005. // If the media type was specified then it's gotten by now.
  1006. arg_array.DeleteAllMembers();
  1007. return TRUE;
  1008. }