home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Today - The Disc! 2 / CD-ROM_Today_-_The_Disc_2_June-July_1994.iso / wfsound / msdetect.in_ / msdetect.bin
Text File  |  1993-09-23  |  22KB  |  661 lines

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