home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Today (UK) 11 / CDRTODAY.iso / qtsetup / msdetect.inc < prev    next >
Text File  |  1994-10-19  |  22KB  |  673 lines

  1.  
  2. rem ---------------------------------------------------------------------
  3. rem
  4. rem MSDETECT.INC - MSSETUP Include
  5. rem
  6. rem                Version 1.0
  7. rem
  8. rem                (c) 1988-1992 Apple Computer, Inc. All Rights Reserved.
  9. rem
  10. rem ---------------------------------------------------------------------
  11.  
  12. '**************************************************************************
  13. '*************************  Setup Detect API's  ***************************
  14. '**************************************************************************
  15.  
  16. ''detect
  17.  
  18. DECLARE FUNCTION CbGetVersionOfFile LIB "msdetstf.dll" (szFile$, szBuf$, cbBuf%) AS INTEGER
  19. DECLARE FUNCTION LGetVersionNthField LIB "msdetstf.dll" (szVersion$, nField%) AS LONG
  20. DECLARE FUNCTION LcbGetSizeOfFile LIB "msdetstf.dll" (szFile$) AS LONG
  21. DECLARE FUNCTION FGetValidDrivesList LIB "msdetstf.dll" (szSymbol$) AS INTEGER
  22. DECLARE FUNCTION FGetLocalHardDrivesList LIB "msdetstf.dll" (szSymbol$) AS INTEGER
  23. DECLARE FUNCTION FGetRemovableDrivesList LIB "msdetstf.dll" (szSymbol$) AS INTEGER
  24. DECLARE FUNCTION FGetNetworkDrivesList LIB "msdetstf.dll" (szSymbol$) AS INTEGER
  25. DECLARE FUNCTION LcbTotalDrive LIB "msdetstf.dll" (nDrive%) AS LONG
  26. DECLARE FUNCTION LcbFreeDrive LIB "msdetstf.dll" (nDrive%) AS LONG
  27. DECLARE FUNCTION FIsValidDrive LIB "msdetstf.dll" (nDrive%) AS INTEGER
  28. DECLARE FUNCTION FIsLocalHardDrive LIB "msdetstf.dll" (nDrive%) AS INTEGER
  29. DECLARE FUNCTION FIsRemoveDrive LIB "msdetstf.dll" (nDrive%) AS INTEGER
  30. DECLARE FUNCTION FIsRemoteDrive LIB "msdetstf.dll" (nDrive%) AS INTEGER
  31. DECLARE FUNCTION FDirExists LIB "msdetstf.dll" (szDir$) AS INTEGER
  32. DECLARE FUNCTION FDoesFileExist LIB "msdetstf.dll" (szFileName$, mode%) AS INTEGER
  33. DECLARE FUNCTION CbGetDateOfFile LIB "msdetstf.dll" (szFile$, szBuf$, cbBuf%) AS INTEGER
  34. DECLARE FUNCTION FDoesIniSectionExist LIB "msdetstf.dll" (szFile$, szSect$) AS INTEGER
  35. DECLARE FUNCTION FDoesIniKeyExist LIB "msdetstf.dll" (szFile$, szSect$, szKey$) AS INTEGER
  36. DECLARE FUNCTION CbGetIniKeyString LIB "msdetstf.dll" (szFile$, szSect$, szKey$, szBuf$, cbBuf%) AS INTEGER
  37. DECLARE FUNCTION WGetDOSMajorVersion LIB "msdetstf.dll" AS INTEGER
  38. DECLARE FUNCTION WGetDOSMinorVersion LIB "msdetstf.dll" AS INTEGER
  39. DECLARE FUNCTION CbGetEnvVariableValue LIB "msdetstf.dll" (szEnvVar$, szBuf$, cbBuf%) AS INTEGER
  40. DECLARE FUNCTION WGetNumWinApps LIB "msdetstf.dll" AS INTEGER
  41. DECLARE FUNCTION FGetParallelPortsList LIB "msdetstf.dll" (szSymbol$) AS INTEGER
  42. DECLARE FUNCTION FGetSerialPortsList LIB "msdetstf.dll" (szSymbol$) AS INTEGER
  43. DECLARE FUNCTION FHas87MathChip LIB "msdetstf.dll" AS INTEGER
  44. DECLARE FUNCTION FHasMonochromeDisplay LIB "msdetstf.dll" AS INTEGER
  45. DECLARE FUNCTION FHasMouseInstalled LIB "msdetstf.dll" AS INTEGER
  46. DECLARE FUNCTION WGetConfigSmartdrvSize LIB "msdetstf.dll" AS INTEGER
  47. DECLARE FUNCTION WGetConfigRamdriveSize LIB "msdetstf.dll" AS INTEGER
  48. DECLARE FUNCTION WGetConfigNumBuffers LIB "msdetstf.dll" AS INTEGER
  49. DECLARE FUNCTION WGetConfigNumFiles LIB "msdetstf.dll" AS INTEGER
  50. DECLARE FUNCTION WGetConfigLastDrive LIB "msdetstf.dll" AS INTEGER
  51. DECLARE FUNCTION FIsDriverInConfig LIB "msdetstf.dll" (szDrv$) AS INTEGER
  52. DECLARE FUNCTION CbFindTargetOnEnvVar LIB "msdetstf.dll" (szFile$, szEnvVar$, szBuf$, cbBuf%) AS INTEGER
  53. DECLARE FUNCTION CbFindFileInTree LIB "msdetstf.dll" (szFile$, szDir$, szBuf$, cbBuf%) AS INTEGER
  54. DECLARE FUNCTION GetTypeFaceNameFromTTF LIB "msdetstf.dll" (szFile$, szBuf$, cbBuf%) AS INTEGER
  55. DECLARE FUNCTION GetExistingFOTFileForTTF LIB "msdetstf.dll" (szFile$, szBuf$, cbBuf%) AS INTEGER
  56.  
  57.  
  58.  
  59. '*************************************************************************
  60. '****************  Detect Basic Wrapper Declarations  ********************
  61. '*************************************************************************
  62.  
  63.  
  64. '' detect
  65.  
  66. DECLARE FUNCTION IsDriveValid (szDrive$) AS INTEGER
  67. DECLARE FUNCTION IsDriveLocalHard (szDrive$) AS INTEGER
  68. DECLARE FUNCTION IsDriveRemovable (szDrive$) AS INTEGER
  69. DECLARE FUNCTION IsDriveNetwork (szDrive$) AS INTEGER
  70. DECLARE SUB GetValidDrivesList (szSymbol$)
  71. DECLARE SUB GetLocalHardDrivesList (szSymbol$)
  72. DECLARE SUB GetRemovableDrivesList (szSymbol$)
  73. DECLARE SUB GetNetworkDrivesList (szSymbol$)
  74. DECLARE FUNCTION GetTotalSpaceForDrive (szDrive$) AS LONG
  75. DECLARE FUNCTION GetFreeSpaceForDrive (szDrive$) AS LONG
  76.  
  77. DECLARE FUNCTION GetDOSMajorVersion AS INTEGER
  78. DECLARE FUNCTION GetDOSMinorVersion AS INTEGER
  79. DECLARE FUNCTION GetEnvVariableValue (szEnvVar$) AS STRING
  80. DECLARE FUNCTION GetNumWinApps AS INTEGER
  81.  
  82. DECLARE FUNCTION DoesFileExist (szFile$, mode%) AS INTEGER
  83. DECLARE FUNCTION GetDateOfFile (szFile$) AS STRING
  84. DECLARE FUNCTION GetYearFromDate (szDate$) AS INTEGER
  85. DECLARE FUNCTION GetMonthFromDate (szDate$) AS INTEGER
  86. DECLARE FUNCTION GetDayFromDate (szDate$) AS INTEGER
  87. DECLARE FUNCTION GetHourFromDate (szDate$) AS INTEGER
  88. DECLARE FUNCTION GetMinuteFromDate (szDate$) AS INTEGER
  89. DECLARE FUNCTION GetSecondFromDate (szDate$) AS INTEGER
  90. DECLARE FUNCTION GetVersionOfFile (szFile$) AS STRING
  91. DECLARE FUNCTION GetVersionNthField (szVersion$, nField%) AS LONG
  92. DECLARE FUNCTION GetSizeOfFile (szFile$) AS LONG
  93. DECLARE FUNCTION FindTargetOnEnvVar (szFile$, szEnvVar$) AS STRING
  94. DECLARE FUNCTION FindFileInTree (szFile$, szDir$) AS STRING
  95. DECLARE FUNCTION DoesDirExist (szDir$) AS INTEGER
  96.  
  97. DECLARE FUNCTION DoesIniSectionExist (szFile$, szSect$) AS INTEGER
  98. DECLARE FUNCTION DoesIniKeyExist (szFile$, szSect$, szKey$) AS INTEGER
  99. DECLARE FUNCTION GetIniKeyString (szFile$, szSect$, szKey$) AS STRING
  100.  
  101. DECLARE FUNCTION GetConfigSmartdrvSize AS INTEGER
  102. DECLARE FUNCTION GetConfigRamdriveSize AS INTEGER
  103. DECLARE FUNCTION GetConfigNumBuffers AS INTEGER
  104. DECLARE FUNCTION GetConfigNumFiles AS INTEGER
  105. DECLARE FUNCTION GetConfigLastDrive AS STRING
  106. DECLARE FUNCTION IsDriverInConfig (szDrv$) AS INTEGER
  107.  
  108. DECLARE FUNCTION GetProcessorType AS INTEGER
  109. DECLARE SUB GetParallelPortsList (szSymbol$)
  110. DECLARE SUB GetSerialPortsList (szSymbol$)
  111. DECLARE FUNCTION Has87MathChip AS INTEGER
  112. DECLARE FUNCTION HasMonochromeDisplay AS INTEGER
  113. DECLARE FUNCTION HasMouseInstalled AS INTEGER
  114.  
  115.  
  116. '*************************************************************************
  117. FUNCTION IsDriveValid (szDrive$) STATIC  AS INTEGER
  118. '$ifdef DEBUG
  119.     if FValidDrive(szDrive$) = 0 then
  120.         BadArgErr 1, "IsDriveValid", szDrive$
  121.     end if
  122. '$endif ''DEBUG
  123.     IsDriveValid = FIsValidDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1)
  124. END FUNCTION
  125.  
  126.  
  127. '*************************************************************************
  128. FUNCTION IsDriveLocalHard (szDrive$) STATIC  AS INTEGER
  129. '$ifdef DEBUG
  130.     if FValidDrive(szDrive$) = 0 then
  131.         BadArgErr 1, "IsDriveLocalHard", szDrive$
  132.     end if
  133. '$endif ''DEBUG
  134.     IsDriveLocalHard = FIsLocalHardDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1)
  135. END FUNCTION
  136.  
  137.  
  138. '*************************************************************************
  139. FUNCTION IsDriveRemovable (szDrive$) STATIC  AS INTEGER
  140. '$ifdef DEBUG
  141.     if FValidDrive(szDrive$) = 0 then
  142.         BadArgErr 1, "IsDriveRemovable", szDrive$
  143.     end if
  144. '$endif ''DEBUG
  145.     IsDriveRemovable = FIsRemoveDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1)
  146. END FUNCTION
  147.  
  148.  
  149. '*************************************************************************
  150. FUNCTION IsDriveNetwork (szDrive$) STATIC  AS INTEGER
  151. '$ifdef DEBUG
  152.     if FValidDrive(szDrive$) = 0 then
  153.         BadArgErr 1, "IsDriveNetwork", szDrive$
  154.     end if
  155. '$endif ''DEBUG
  156.     IsDriveNetwork = FIsRemoteDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1)
  157. END FUNCTION
  158.  
  159.  
  160. '*************************************************************************
  161. FUNCTION GetTotalSpaceForDrive (szDrive$) STATIC  AS LONG
  162. '$ifdef DEBUG
  163.     if FValidDrive(szDrive$) = 0 then
  164.         BadArgErr 1, "GetTotalSpaceForDrive", szDrive$
  165.     end if
  166. '$endif ''DEBUG
  167.     GetTotalSpaceForDrive = LcbTotalDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1)
  168. END FUNCTION
  169.  
  170.  
  171. '*************************************************************************
  172. FUNCTION GetFreeSpaceForDrive (szDrive$) STATIC  AS LONG
  173. '$ifdef DEBUG
  174.     if FValidDrive(szDrive$) = 0 then
  175.         BadArgErr 1, "GetFreeSpaceForDrive", szDrive$
  176.     end if
  177. '$endif ''DEBUG
  178.     GetFreeSpaceForDrive = LcbFreeDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1)
  179. END FUNCTION
  180.  
  181.  
  182. '*************************************************************************
  183. SUB GetValidDrivesList (szSymbol$) STATIC
  184. '$ifdef DEBUG
  185.     if szSymbol$ = "" then
  186.         BadArgErr 1, "GetValidDrivesList", szSymbol$
  187.     end if
  188. '$endif ''DEBUG
  189.     if FGetValidDrivesList(szSymbol$) = 0 then
  190. '$ifdef DEBUG
  191.         StfApiErr saeFail, "GetValidDrivesList", szSymbol$
  192. '$endif ''DEBUG
  193.         ERROR STFERR
  194.     end if
  195. END SUB
  196.  
  197.  
  198. '*************************************************************************
  199. SUB GetLocalHardDrivesList (szSymbol$) STATIC
  200. '$ifdef DEBUG
  201.     if szSymbol$ = "" then
  202.         BadArgErr 1, "GetLocalHardDrivesList", szSymbol$
  203.     end if
  204. '$endif ''DEBUG
  205.     if FGetLocalHardDrivesList(szSymbol$) = 0 then
  206. '$ifdef DEBUG
  207.         StfApiErr saeFail, "GetLocalHardDrivesList", szSymbol$
  208. '$endif ''DEBUG
  209.         ERROR STFERR
  210.     end if
  211. END SUB
  212.  
  213.  
  214. '*************************************************************************
  215. SUB GetRemovableDrivesList (szSymbol$) STATIC
  216. '$ifdef DEBUG
  217.     if szSymbol$ = "" then
  218.         BadArgErr 1, "GetRemovableDrivesList", szSymbol$
  219.     end if
  220. '$endif ''DEBUG
  221.     if FGetRemovableDrivesList(szSymbol$) = 0 then
  222. '$ifdef DEBUG
  223.         StfApiErr saeFail, "GetRemovableDrivesList", szSymbol$
  224. '$endif ''DEBUG
  225.         ERROR STFERR
  226.     end if
  227. END SUB
  228.  
  229.  
  230. '*************************************************************************
  231. SUB GetNetworkDrivesList (szSymbol$) STATIC
  232. '$ifdef DEBUG
  233.     if szSymbol$ = "" then
  234.         BadArgErr 1, "GetNetworkDrivesList", szSymbol$
  235.     end if
  236. '$endif ''DEBUG
  237.     if FGetNetworkDrivesList(szSymbol$) = 0 then
  238. '$ifdef DEBUG
  239.         StfApiErr saeFail, "GetNetworkDrivesList", szSymbol$
  240. '$endif ''DEBUG
  241.         ERROR STFERR
  242.     end if
  243. END SUB
  244.  
  245.  
  246. '*************************************************************************
  247. FUNCTION GetDOSMajorVersion STATIC  AS INTEGER
  248.     GetDOSMajorVersion = WGetDOSMajorVersion
  249. END FUNCTION
  250.  
  251.  
  252. '*************************************************************************
  253. FUNCTION GetDOSMinorVersion STATIC  AS INTEGER
  254.     GetDOSMinorVersion = WGetDOSMinorVersion
  255. END FUNCTION
  256.  
  257.  
  258. '*************************************************************************
  259. FUNCTION GetEnvVariableValue (szEnvVar$) STATIC  AS STRING
  260. '$ifdef DEBUG
  261.     if szEnvVar$ = "" then
  262.         BadArgErr 1, "GetEnvVariableValue", szEnvVar$
  263.     end if
  264. '$endif ''DEBUG
  265.     cb% = 1024
  266.     szBuf$ = STRING$(cb%, 32)
  267.     cbRet% = CbGetEnvVariableValue(szEnvVar$, szBuf$, cb%)
  268.     GetEnvVariableValue = szBuf$
  269. '$ifdef DEBUG
  270.     IF cbRet% >= cb% THEN
  271.         StfApiErr saeOvfl, "GetEnvVariableValue", szEnvVar$
  272.         ERROR STFERR
  273.     END IF
  274. '$endif ''DEBUG
  275.     szBuf$ = ""
  276. END FUNCTION
  277.  
  278.  
  279. '*************************************************************************
  280. FUNCTION GetNumWinApps STATIC  AS INTEGER
  281.     GetNumWinApps = WGetNumWinApps
  282. END FUNCTION
  283.  
  284.  
  285. '*************************************************************************
  286. FUNCTION DoesFileExist (szFileName$, mode%) STATIC  AS INTEGER
  287. '$ifdef DEBUG
  288.     if FValidFATPath(szFileName$) = 0 then
  289.         BadArgErr 1, "DoesFileExist", szFileName$+", "+STR$(mode%)
  290.     end if
  291. '$endif ''DEBUG
  292.     DoesFileExist = FDoesFileExist(szFileName$, mode%)
  293. END FUNCTION
  294.  
  295.  
  296. '*************************************************************************
  297. FUNCTION GetDateOfFile (szFile$) STATIC  AS STRING
  298. '$ifdef DEBUG
  299.     if FValidFATPath(szFile$) = 0 then
  300.         BadArgErr 1, "GetDateOfFile", szFile$
  301.     end if
  302. '$endif ''DEBUG
  303.     cb% = 20
  304.     szBuf$ = STRING$(cb%, 32)
  305.     cbRet% = CbGetDateOfFile(szFile$, szBuf$, cb%)
  306.     GetDateOfFile = szBuf$
  307. '$ifdef DEBUG
  308.     IF cbRet% >= cb% THEN
  309.         StfApiErr saeOvfl, "GetDateOfFile", szFile$
  310.         ERROR STFERR
  311.     END IF
  312. '$endif ''DEBUG
  313.     szBuf$ = ""
  314. END FUNCTION
  315.  
  316.  
  317. '*************************************************************************
  318. FUNCTION GetYearFromDate (szDate$) STATIC  AS INTEGER
  319. '$ifdef DEBUG
  320.     if szDate = "" then
  321.         BadArgErr 1, "GetYearFromDate", szDate$
  322.     end if
  323. '$endif ''DEBUG
  324.     GetYearFromDate = VAL(MID$(szDate$, 1, 4))
  325. END FUNCTION
  326.  
  327.  
  328. '*************************************************************************
  329. FUNCTION GetMonthFromDate (szDate$) STATIC  AS INTEGER
  330. '$ifdef DEBUG
  331.     if szDate = "" then
  332.         BadArgErr 1, "GetMonthFromDate", szDate$
  333.     end if
  334. '$endif ''DEBUG
  335.     GetMonthFromDate = VAL(MID$(szDate$, 6, 2))
  336. END FUNCTION
  337.  
  338.  
  339. '*************************************************************************
  340. FUNCTION GetDayFromDate (szDate$) STATIC  AS INTEGER
  341. '$ifdef DEBUG
  342.     if szDate = "" then
  343.         BadArgErr 1, "GetDayFromDate", szDate$
  344.     end if
  345. '$endif ''DEBUG
  346.     GetDayFromDate = VAL(MID$(szDate$, 9, 2))
  347. END FUNCTION
  348.  
  349.  
  350. '*************************************************************************
  351. FUNCTION GetHourFromDate (szDate$) STATIC  AS INTEGER
  352. '$ifdef DEBUG
  353.     if szDate = "" then
  354.         BadArgErr 1, "GetHourFromDate", szDate$
  355.     end if
  356. '$endif ''DEBUG
  357.     GetHourFromDate = VAL(MID$(szDate$, 12, 2))
  358. END FUNCTION
  359.  
  360.  
  361. '*************************************************************************
  362. FUNCTION GetMinuteFromDate (szDate$) STATIC  AS INTEGER
  363. '$ifdef DEBUG
  364.     if szDate = "" then
  365.         BadArgErr 1, "GetMinuteFromDate", szDate$
  366.     end if
  367. '$endif ''DEBUG
  368.     GetMinuteFromDate = VAL(MID$(szDate$, 15, 2))
  369. END FUNCTION
  370.  
  371.  
  372. '*************************************************************************
  373. FUNCTION GetSecondFromDate (szDate$) STATIC  AS INTEGER
  374. '$ifdef DEBUG
  375.     if szDate = "" then
  376.         BadArgErr 1, "GetSecondFromDate", szDate$
  377.     end if
  378. '$endif ''DEBUG
  379.     GetSecondFromDate = VAL(MID$(szDate$, 18, 2))
  380. END FUNCTION
  381.  
  382.  
  383. '*************************************************************************
  384. FUNCTION GetVersionOfFile (szFile$) STATIC  AS STRING
  385. '$ifdef DEBUG
  386.     if FValidFATPath(szFile$) = 0 then
  387.         BadArgErr 1, "GetVersionOfFile", szFile$
  388.     end if
  389. '$endif ''DEBUG
  390.     cb% = 30
  391.     szBuf$ = STRING$(cb%, 32)
  392.     cbRet% = CbGetVersionOfFile(szFile$, szBuf$, cb%)
  393.     GetVersionOfFile = szBuf$
  394. '$ifdef DEBUG
  395.     IF cbRet% >= cb% THEN
  396.         StfApiErr saeOvfl, "GetVersionOfFile", szFile$
  397.         ERROR STFERR
  398.     END IF
  399. '$endif ''DEBUG
  400.     szBuf$ = ""
  401. END FUNCTION
  402.  
  403.  
  404. '*************************************************************************
  405. FUNCTION GetVersionNthField (szVersion$, nField%) STATIC  AS LONG
  406. '$ifdef DEBUG
  407.     if (nField% < 1) OR (nField% > 4) then
  408.         BadArgErr 2, "GetVersionNthField", szVersion$+", "+STR$(nField%)
  409.     end if
  410. '$endif ''DEBUG
  411.     GetVersionNthField = LGetVersionNthField(szVersion$, nField%)
  412. END FUNCTION
  413.  
  414.  
  415. '*************************************************************************
  416. FUNCTION GetSizeOfFile (szFile$) STATIC  AS LONG
  417. '$ifdef DEBUG
  418.     if FValidFATPath(szFile$) = 0 then
  419.         BadArgErr 1, "GetSizeOfFile", szFile$
  420.     end if
  421. '$endif ''DEBUG
  422.     GetSizeOfFile = LcbGetSizeOfFile(szFile$)
  423. END FUNCTION
  424.  
  425.  
  426. '*************************************************************************
  427. FUNCTION FindTargetOnEnvVar (szFile$, szEnvVar$) STATIC  AS STRING
  428. '$ifdef DEBUG
  429.     if CchlValidFATSubPath(szFile$) = 0 then
  430.         n% = 1
  431.     elseif szEnvVar$ = "" then
  432.         n% = 2
  433.     else
  434.         n% = 0
  435.     end if
  436.     if n% > 0 then
  437.         BadArgErr n%, "FindTargetOnEnvVar", szFile$+", "+szEnvVar$
  438.     end if
  439. '$endif ''DEBUG
  440.  
  441.     cb% = 512
  442.     szBuf$ = STRING$(cb%, 32)
  443.     cbRet% = CbFindTargetOnEnvVar(szFile$, szEnvVar$, szBuf$, cb%)
  444.     IF cbRet% >= cb% THEN
  445. '$ifdef DEBUG
  446.         StfApiErr saeOvfl, "FindTargetOnEnvVar", szFile$+", "+szEnvVar$
  447. '$endif ''DEBUG
  448.         ERROR STFERR
  449.     END IF
  450.     szBuf$ = RTRIM$(szBuf$)
  451.     IF MID$(szBuf$, 1, 1) = "\" THEN
  452.        szBuf$ = MID$(CURDIR$, 1, 2) + szBuf$
  453.     ELSEIF Len(szBuf$) > 0 AND MID$(szBuf$, 2, 1) <> ":" THEN
  454.        szBuf$ = MID$(CURDIR$, 1, 3) + szBuf$
  455.     END IF
  456.     FindTargetOnEnvVar = szBuf$
  457.     szBuf$ = ""
  458. END FUNCTION
  459.  
  460.  
  461. '*************************************************************************
  462. FUNCTION FindFileInTree (szFile$, szDir$) STATIC  AS STRING
  463. '$ifdef DEBUG
  464.     if CchlValidFATSubPath(szFile$) = 0 then
  465.         n% = 1
  466.     elseif FValidFATDir(szDir$) = 0 then
  467.         n% = 2
  468.     else
  469.         n% = 0
  470.     end if
  471.     if n% > 0 then
  472.         BadArgErr n%, "FindFileInTree", szFile$+", "+szDir$
  473.     end if
  474. '$endif ''DEBUG
  475.  
  476.     cb% = 512
  477.     szBuf$ = STRING$(cb%, 32)
  478.     cbRet% = CbFindFileInTree(szFile$, szDir$, szBuf$, cb%)
  479.     FindFileInTree = szBuf$
  480. '$ifdef DEBUG
  481.     IF cbRet% >= cb% THEN
  482.         StfApiErr saeOvfl, "FindFileInTree", szFile$+", "+szDir$
  483.         ERROR STFERR
  484.     END IF
  485. '$endif ''DEBUG
  486.     szBuf$ = ""
  487. END FUNCTION
  488.  
  489.  
  490. '*************************************************************************
  491. FUNCTION GetConfigSmartdrvSize STATIC  AS INTEGER
  492.     GetConfigSmartdrvSize = WGetConfigSmartdrvSize
  493. END FUNCTION
  494.  
  495.  
  496. '*************************************************************************
  497. FUNCTION GetConfigRamdriveSize STATIC  AS INTEGER
  498.     GetConfigRamdriveSize = WGetConfigRamdriveSize
  499. END FUNCTION
  500.  
  501.  
  502. '*************************************************************************
  503. FUNCTION GetConfigNumBuffers STATIC  AS INTEGER
  504.     GetConfigNumBuffers = WGetConfigNumBuffers
  505. END FUNCTION
  506.  
  507.  
  508. '*************************************************************************
  509. FUNCTION GetConfigNumFiles STATIC  AS INTEGER
  510.     GetConfigNumFiles = WGetConfigNumFiles
  511. END FUNCTION
  512.  
  513.  
  514. '*************************************************************************
  515. FUNCTION GetConfigLastDrive STATIC  AS STRING
  516.     chRet% = WGetConfigLastDrive
  517.     if chRet% = 0 then
  518.         GetConfigLastDrive = ""
  519.     else
  520.         GetConfigLastDrive = CHR$(chRet%)
  521.     end if
  522. END FUNCTION
  523.  
  524.  
  525. '*************************************************************************
  526. FUNCTION IsDriverInConfig (szDrv$) STATIC  AS INTEGER
  527. '$ifdef DEBUG
  528.     if szDrv$ = "" then
  529.         BadArgErr 1, "IsDriverInConfig", szDrv$
  530.     end if
  531. '$endif ''DEBUG
  532.     IsDriverInConfig = FIsDriverInConfig(szDrv$)
  533. END FUNCTION
  534.  
  535.  
  536. '*************************************************************************
  537. FUNCTION GetProcessorType STATIC  AS INTEGER
  538.     GetProcessorType = 0
  539.     longTmp& = GetWinFlags()
  540.     IF longTmp& AND WF_CPU486 THEN
  541.         GetProcessorType = 4
  542.     ELSEIF longTmp& AND WF_CPU386 THEN
  543.         GetProcessorType = 3
  544.     ELSEIF longTmp& AND WF_CPU286 THEN
  545.         GetProcessorType = 2
  546.     ELSEIF longTmp& AND WF_CPU186 THEN
  547.         GetProcessorType = 1
  548.     END IF
  549. END FUNCTION
  550.  
  551.  
  552. '*************************************************************************
  553. SUB GetParallelPortsList (szSymbol$) STATIC
  554. '$ifdef DEBUG
  555.     if szSymbol$ = "" then
  556.         BadArgErr 1, "GetParallelPortsList", szSymbol$
  557.     end if
  558. '$endif ''DEBUG
  559.     if FGetParallelPortsList(szSymbol$) = 0 then
  560. '$ifdef DEBUG
  561.         StfApiErr saeFail, "GetParallelPortsList", szSymbol$
  562. '$endif ''DEBUG
  563.         ERROR STFERR
  564.     end if
  565. END SUB
  566.  
  567.  
  568. '*************************************************************************
  569. SUB GetSerialPortsList (szSymbol$) STATIC
  570. '$ifdef DEBUG
  571.     if szSymbol$ = "" then
  572.         BadArgErr 1, "GetSerialPortsList", szSymbol$
  573.     end if
  574. '$endif ''DEBUG
  575.     if FGetSerialPortsList(szSymbol$) = 0 then
  576. '$ifdef DEBUG
  577.         StfApiErr saeFail, "GetSerialPortsList", szSymbol$
  578. '$endif ''DEBUG
  579.         ERROR STFERR
  580.     end if
  581. END SUB
  582.  
  583.  
  584. '*************************************************************************
  585. FUNCTION Has87MathChip STATIC  AS INTEGER
  586.     Has87MathChip = FHas87MathChip
  587. END FUNCTION
  588.  
  589.  
  590. '*************************************************************************
  591. FUNCTION HasMonochromeDisplay STATIC  AS INTEGER
  592.     HasMonochromeDisplay = FHasMonochromeDisplay
  593. END FUNCTION
  594.  
  595.  
  596. '*************************************************************************
  597. FUNCTION HasMouseInstalled STATIC  AS INTEGER
  598.     HasMouseInstalled = FHasMouseInstalled
  599. END FUNCTION
  600.  
  601.  
  602. '*************************************************************************
  603. FUNCTION DoesDirExist (szDir$) STATIC  AS INTEGER
  604. '$ifdef DEBUG
  605.     if FValidFATDir(szDir$) = 0 then
  606.         BadArgErr 1, "DoesDirExist", szDir$
  607.     end if
  608. '$endif ''DEBUG
  609.     DoesDirExist = FDirExists(szDir$)
  610. END FUNCTION
  611.  
  612.  
  613. '*************************************************************************
  614. FUNCTION DoesIniSectionExist (szFile$, szSect$) STATIC  AS INTEGER
  615. '$ifdef DEBUG
  616.     if FValidIniFile(szFile$) = 0 then
  617.         BadArgErr 1, "DoesIniSectionExist", szFile$+", "+szSect$
  618.     end if
  619. '$endif ''DEBUG
  620.     DoesIniSectionExist = FDoesIniSectionExist(szFile$, szSect$)
  621. END FUNCTION
  622.  
  623.  
  624. '*************************************************************************
  625. FUNCTION DoesIniKeyExist (szFile$, szSect$, szKey$) STATIC  AS INTEGER
  626. '$ifdef DEBUG
  627.     if FValidIniFile(szFile$) = 0 then
  628.         n% = 1
  629.     elseif szKey$ = "" then
  630.         n% = 3
  631.     else
  632.         n% = 0
  633.     end if
  634.     if n% > 0 then
  635.         BadArgErr n%, "DoesIniKeyExist", szFile$+", "+szSect$+", "+szKey$
  636.     end if
  637. '$endif ''DEBUG
  638.  
  639.     DoesIniKeyExist = FDoesIniKeyExist(szFile$, szSect$, szKey$)
  640. END FUNCTION
  641.  
  642.  
  643. '*************************************************************************
  644. FUNCTION GetIniKeyString (szFile$, szSect$, szKey$) STATIC  AS STRING
  645. '$ifdef DEBUG
  646.     if FValidIniFile(szFile$) = 0 then
  647.         n% = 1
  648.     elseif szKey$ = "" then
  649.         n% = 3
  650.     else
  651.         n% = 0
  652.     end if
  653.     if n% > 0 then
  654.         BadArgErr n%, "GetIniKeyString", szFile$+", "+szSect$+", "+szKey$
  655.     end if
  656. '$endif ''DEBUG
  657.  
  658.     cb% = 512
  659.     szBuf$ = STRING$(cb%, 32)
  660.     cbRet% = CbGetIniKeyString(szFile$, szSect$, szKey$, szBuf$, cb%)
  661.     GetIniKeyString = szBuf$
  662. '$ifdef DEBUG
  663.     IF cbRet% >= cb% THEN
  664.         StfApiErr saeOvfl, "GetIniKeyString", szFile$+", "+szSect$+", "+szKey$
  665.         ERROR STFERR
  666.     END IF
  667. '$endif ''DEBUG
  668.     szBuf$ = ""
  669. END FUNCTION
  670.  
  671.  
  672.  
  673.