⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setupapi.inc

📁 borland c++ 4.0 用于学习ucos的
💻 INC
📖 第 1 页 / 共 4 页
字号:
    if FValidFATDir(szDir$) = 0 then
        BadArgErr 1, "CreateDir", szDir$+", "+STR$(cmo%)
    end if
'$endif ''DEBUG
    IF FCreateDir(szDir$, cmo%) = 0 THEN
'$ifdef DEBUG
        StfApiErr saeFail, "CreateDir", szDir$+", "+STR$(cmo%)
'$endif ''DEBUG
        ERROR STFERR
    END IF
END SUB


'*************************************************************************
SUB RemoveDir (szDir$, cmo%) STATIC
'$ifdef DEBUG
    if FValidFATDir(szDir$) = 0 then
        BadArgErr 1, "RemoveDir", szDir$+", "+STR$(cmo%)
    end if
'$endif ''DEBUG
    IF FRemoveDir(szDir$, cmo%) = 0 THEN
'$ifdef DEBUG
        StfApiErr saeFail, "RemoveDir", szDir$+", "+STR$(cmo%)
'$endif ''DEBUG
        ERROR STFERR
    END IF
END SUB



'*************************************************************************
SUB RemoveIniSection (szFile$, szSect$, cmo%) STATIC
'$ifdef DEBUG
    if FValidIniFile(szFile$) = 0 then
        n% = 1
    elseif FValidInfSect(szSect$) = 0 then
        n% = 2
    else
        n% = 0
    end if
    if n% > 0 then
        BadArgErr n%, "RemoveIniSection", szFile$+", "+szSect$+", "+STR$(cmo%)
    end if
'$endif ''DEBUG

    IF FRemoveIniSection(szFile$, szSect$, cmo%) = 0 THEN
'$ifdef DEBUG
        StfApiErr saeFail, "RemoveIniSection", szFile$+", "+szSect$+", "+STR$(cmo%)
'$endif ''DEBUG
        ERROR STFERR
    END IF
END SUB


'*************************************************************************
SUB CreateIniKeyValue (szFile$, szSect$, szKey$, szValue$, cmo%) STATIC
'$ifdef DEBUG
    if FValidIniFile(szFile$) = 0 then
        n% = 1
    elseif FValidInfSect(szSect$) = 0 then
        n% = 2
    else
        n% = 0
    end if
    if n% > 0 then
        BadArgErr n%, "CreateIniKeyValue", szFile$+", "+szSect$+", "+szKey$+", "+szValue$+", "+STR$(cmo%)
    end if
'$endif ''DEBUG

    IF FCreateIniKeyValue(szFile$, szSect$, szKey$, szValue$, cmo%) = 0 THEN
'$ifdef DEBUG
        StfApiErr saeFail, "CreateIniKeyValue", szFile$+", "+szSect$+", "+szKey$+", "+szValue$+", "+STR$(cmo%)
'$endif ''DEBUG
        ERROR STFERR
    END IF
END SUB


'*************************************************************************
SUB RemoveIniKey (szFile$, szSect$, szKey$, cmo%) STATIC
'$ifdef DEBUG
    if FValidIniFile(szFile$) = 0 then
        n% = 1
    elseif FValidInfSect(szSect$) = 0 then
        n% = 2
    elseif szKey$ = "" then
        n% = 3
    else
        n% = 0
    end if
    if n% > 0 then
        BadArgErr n%, "RemoveIniKey", szFile$+", "+szSect$+", "+szKey$+", "+STR$(cmo%)
    end if
'$endif ''DEBUG

    IF FRemoveIniKey(szFile$, szSect$, szKey$, cmo%) = 0 THEN
'$ifdef DEBUG
        StfApiErr saeFail, "RemoveIniKey", szFile$+", "+szSect$+", "+szKey$+", "+STR$(cmo%)
'$endif ''DEBUG
        ERROR STFERR
    END IF
END SUB


'*************************************************************************
SUB CreateSysIniKeyValue (szFile$, szSect$, szKey$, szValue$, cmo%) STATIC
'$ifdef DEBUG
    if FValidFATPath(szFile$) = 0 then
        n% = 1
    elseif FValidInfSect(szSect$) = 0 then
        n% = 2
    elseif szKey$ = "" then
        n% = 3
    else
        n% = 0
    end if
    if n% > 0 then
        BadArgErr n%, "CreateSysIniKeyValue", szFile$+", "+szSect$+", "+szKey$+", "+szValue$+", "+STR$(cmo%)
    end if
'$endif ''DEBUG

    IF FCreateSysIniKeyValue(szFile$, szSect$, szKey$, szValue$, cmo%) = 0 THEN
'$ifdef DEBUG
        StfApiErr saeFail, "CreateSysIniKeyValue", szFile$+", "+szSect$+", "+szKey$+", "+szValue$+", "+STR$(cmo%)
'$endif ''DEBUG
        ERROR STFERR
    END IF
END SUB


'*************************************************************************
SUB CreateProgmanGroup (szGroup$, szPath$, cmo%) STATIC
'$ifdef DEBUG
    if szGroup$ = "" or len(szGroup$) > 24 then
        BadArgErr 1, "CreateProgmanGroup", szGroup$+", "+STR$(Cmd%)+", "+STR$(cmo%)
    end if
'$endif ''DEBUG
    IF FCreateProgManGroup(szGroup$, szPath$, cmo%) = 0 THEN
'$ifdef DEBUG
        StfApiErr saeFail, "CreateProgmanGroup", szGroup$+", "+szPath$+", "+STR$(cmo%)
'$endif ''DEBUG
        ERROR STFERR
    END IF
END SUB


'*************************************************************************
SUB ShowProgmanGroup (szGroup$, Cmd%, cmo%) STATIC
'$ifdef DEBUG
    if szGroup$ = "" or len(szGroup$) > 24 then
        BadArgErr 1, "ShowProgmanGroup", szGroup$+", "+STR$(Cmd%)+", "+STR$(cmo%)
    end if
'$endif ''DEBUG
    IF FShowProgManGroup(szGroup$, STR$(Cmd%), cmo%) = 0 THEN
'$ifdef DEBUG
        StfApiErr saeFail, "ShowProgmanGroup", szGroup$+", "+STR$(Cmd%)+", "+STR$(cmo%)
'$endif ''DEBUG
        ERROR STFERR
    END IF
END SUB


'*************************************************************************
SUB StampResource (szSect$, szKey$, szDst$, wResType%, wResId%, szData$, cbData%) STATIC
'$ifdef DEBUG
    if FValidInfSect(szSect$) = 0 then
        n% = 1
    elseif szKey$ = "" then
        n% = 2
    elseif FValidFATDir(szDst$) = 0 then
        n% = 3
    else
        n% = 0
    end if
    if n% > 0 then
        BadArgErr n%, "StampResource", szSect$+", "+szKey$+", "+szDst$+", "+STR$(wResType%)+", "+STR$(wResId%)+", "+szData$+", "+STR$(cbData%)
    end if
'$endif ''DEBUG

    IF FStampResource (szSect$, szKey$, szDst$, wResType%, wResId%, szData$, cbData%) = 0 THEN
'$ifdef DEBUG
        StfApiErr saeFail, "StampResource", szSect$+", "+szKey$+", "+szDst$+", "+STR$(wResType%)+", "+STR$(wResId%)+", "+szData$+", "+STR$(cbData%)
'$endif ''DEBUG
        ERROR STFERR
    END IF
END SUB


'*************************************************************************
SUB DumpCopyList (szFile$) STATIC
'$ifdef DEBUG
    if szFile$ = "" then
        BadArgErr 1, "DumpCopyList", szFile$
    end if
'$endif ''DEBUG
    IF FDumpCopyListToFile (szFile$) = 0 THEN
'$ifdef DEBUG
        StfApiErr saeFail, "DumpCopyList", szFile$
'$endif ''DEBUG
        ERROR STFERR
    END IF
END SUB


'*************************************************************************
SUB ClearCopyList STATIC
    ResetCopyList
END SUB


'*************************************************************************
FUNCTION GetCopyListCost (szExtraList$, szCostList$, szNeedList$) STATIC AS LONG
    lNeed& = LcbGetCopyListCost (szExtraList$, szCostList$, szNeedList$)
    IF lNeed& < 0 THEN
'$ifdef DEBUG
        StfApiErr saeFail, "GetCopyListCost", szExtraList$+", "+szCostList$+", "+szNeedList$
'$endif ''DEBUG
        ERROR STFERR
    END IF
    GetCopyListCost = lNeed&
END FUNCTION


'*************************************************************************
SUB CreateProgmanItem (szGroup$, szItem$, szCmd$, szOther$, cmo%) STATIC
    szItemNew$ = szItem$
    IF szOther$ <> "" THEN
        szItemNew$ = szItem$ + "," + szOther$
    END IF
'$ifdef DEBUG
    if szGroup$ = "" or len(szGroup$) > 24 then
        BadArgErr 1, "CreateProgmanItem", szGroup$+", "+STR$(Cmd%)+", "+STR$(cmo%)
    end if
'$endif ''DEBUG

    IF FCreateProgManItem(szGroup$, szItemNew$, szCmd$, cmo%) = 0 THEN
'$ifdef DEBUG
        StfApiErr saeFail, "CreateProgmanItem", szGroup$+", "+szItem$+", "+szCmd$+", "+szOther$+", "+STR$(cmo%)
'$endif ''DEBUG
        ERROR STFERR
    END IF
    szItemNew$ = ""
END SUB


'*************************************************************************
SUB AddDos5Help (szProgName$, szProgHelp$, cmo%) STATIC
'$ifdef DEBUG
    if szProgName$ = "" OR MID$(szProgName$, 1, 1) = "@" OR LEN(szProgName$) > 8 then
        n% = 1
    elseif INSTR(szProgName$, " ") <> 0 OR INSTR(szProgName$, CHR$(9)) <> 0 then
        n% = 1
    elseif szProgHelp$ = "" then
        n% = 2
    else
        n% = 0
    end if
    if n% > 0 then
        BadArgErr n%, "AddDos5Help", szProgName$+", "+szProgHelp$+", "+STR$(cmo%)
    end if
'$endif ''DEBUG
    IF FAddDos5Help (szProgName$, szProgHelp$, cmo%) = 0 THEN
'$ifdef DEBUG
        StfApiErr saeFail, "AddDos5Help", szProgName$+", "+szProgHelp$+", "+STR$(cmo%)
'$endif ''DEBUG
        ERROR STFERR
    END IF
END SUB


'*************************************************************************
SUB CopyFilesInCopyList STATIC
    grc% = GrcCopyFilesInCopyList (HinstFrame())

    IF grc% = grcUserQuit THEN
        ERROR STFQUIT
    ELSEIF grc% > 0 THEN
'$ifdef DEBUG
        StfApiErr saeFail, "CopyFilesInCopyList", ""
'$endif ''DEBUG
        ERROR STFERR
    END IF
END SUB


'*************************************************************************
SUB CopyFile (szFullPathSrc$, szFullPathDst$, cmo%, fAppend%) STATIC
'$ifdef DEBUG
    if FValidFATPath(szFullPathSrc$) = 0 then
        n% = 1
    elseif FValidFATPath(szFullPathDst$) = 0 then
        n% = 2
    else
        n% = 0
    end if
    if n% > 0 then
        BadArgErr n%, "CopyFile", szFullPathSrc$+", "+szFullPathDst$+", "+STR$(cmo%)+", "+STR$(fAppend%)
    end if
'$endif ''DEBUG

    IF  FCopyOneFile(szFullPathSrc$, szFullPathDst$, (cmo OR cmoCopy), fAppend%) = 0 THEN
'$ifdef DEBUG
        StfApiErr saeFail, "CopyFile", szFullPathSrc$+", "+szFullPathDst$+", "+STR$(cmo%)+", "+STR$(fAppend%)
'$endif ''DEBUG
        ERROR STFERR
    END IF
END SUB



'*************************************************************************
SUB RemoveFile (szFullPathSrc$, cmo%) STATIC
'$ifdef DEBUG
    if FValidFATPath(szFullPathSrc$) = 0 then
        BadArgErr 1, "RemoveFile", szFullPathSrc$+", "+STR$(cmo%)
    end if
'$endif ''DEBUG
    IF  YnrcRemoveFile(szFullPathSrc$, cmo%) = ynrcNo THEN
'$ifdef DEBUG
        StfApiErr saeFail, "RemoveFile", szFullPathSrc$+", "+STR$(cmo%)
'$endif ''DEBUG
        ERROR STFERR
    END IF
END SUB


'*************************************************************************
SUB BackupFile (szFullPath$, szBackup$) STATIC
'$ifdef DEBUG
    if FValidFATPath(szFullPath$) = 0 then
        n% = 1
    elseif szBackup$ = "" then
        n% = 2
    else
        n% = 0
    end if
    if n% > 0 then
        BadArgErr n%, "BackupFile", szFullPath$+", "+szBackup$
    end if
'$endif ''DEBUG

    IF YnrcBackupFile(szFullPath$, szBackup$, cmoNone) = ynrcNo THEN
'$ifdef DEBUG
        StfApiErr saeFail, "BackupFile", szFullPath$+", "+szBackup$
'$endif ''DEBUG
        ERROR STFERR
    END IF
END SUB


'*************************************************************************
SUB RenameFile (szFullPath$, szBackup$) STATIC
'$ifdef DEBUG
    if FValidFATPath(szFullPath$) = 0 then
        n% = 1
    elseif szBackup$ = "" then
        n% = 2
    else
        n% = 0
    end if
    if n% > 0 then
        BadArgErr n%, "RenameFile", szFullPath$+", "+szBackup$
    end if
'$endif ''DEBUG

    IF YnrcBackupFile(szFullPath$, szBackup$, cmoNone) = ynrcNo THEN
'$ifdef DEBUG
        StfApiErr saeFail, "RenameFile", szFullPath$+", "+szBackup$
'$endif ''DEBUG
        ERROR STFERR
    END IF
END SUB


'*************************************************************************
SUB AddSectionFilesToCopyList (szSect$, szSrc$, szDest$) STATIC
'$ifdef DEBUG
    if FValidInfSect(szSect$) = 0 then
        n% = 1
    elseif FValidFATDir(szSrc$) = 0 then
        n% = 2
    elseif FValidFATDir(szDest$) = 0 then
        n% = 3
    else
        n% = 0
    end if
    if n% > 0 then
        BadArgErr n%, "AddSectionFilesToCopyList", szSect$+", "+szSrc$+", "+szDest$
    end if
'$endif ''DEBUG

    IF FAddSectionFilesToCopyList (szSect$, szSrc$, szDest$) = 0 THEN
'$ifdef DEBUG
        StfApiErr saeFail, "AddSectionFilesToCopyList", szSect$+", "+szSrc$+", "+szDest$
'$endif ''DEBUG
        ERROR STFERR
    END IF
END SUB


'*************************************************************************
SUB AddSectionKeyFileToCopyList (szSect$, szKey$, szSrc$, szDest$) STATIC
'$ifdef DEBUG
    if FValidInfSect(szSect$) = 0 then
        n% = 1
    elseif szKey$ = "" then
        n% = 2
    elseif FValidFATDir(szSrc$) = 0 then
        n% = 3
    elseif FValidFATDir(szDest$) = 0 then
        n% = 4
    else
        n% = 0
    end if
    if n% > 0 then
        BadArgErr n%, "AddSectionKeyFileToCopyList", szSect$+", "+szKey$+", "+szSrc$+", "+szDest$
    end if
'$endif ''DEBUG

    IF FAddSectionKeyFileToCopyList (szSect$, szKey$, szSrc$, szDest$) = 0 THEN
'$ifdef DEBUG
        StfApiErr saeFail, "AddSectionKeyFileToCopyList", szSect$+", "+szKey$+", "+szSrc$+", "+szDest$
'$endif ''DEBUG
        ERROR STFERR
    END IF
END SUB


'*************************************************************************
SUB AddSpecialFileToCopyList (szSect$, szKey$, szSrc$, szDest$) STATIC
'$ifdef DEBUG
    if FValidInfSect(szSect$) = 0 then
        n% = 1
    elseif szKey$ = "" then
        n% = 2
    elseif FValidFATDir(szSrc$) = 0 then
        n% = 3
    elseif FValidFATPath(szDest$) = 0 then
        n% = 4
    else
        n% = 0
    end if
    if n% > 0 then
        BadArgErr n%, "AddSpecialFileToCopyList", szSect$+", "+szKey$+", "+szSrc$+", "+szDest$
    end if
'$endif ''DEBUG

    IF FAddSpecialFileToCopyList (szSect$, szKey$, szSrc$, szDest$) = 0 THEN
'$ifdef DEBUG
        StfApiErr saeFail, "AddSpecialFileToCopyList", szSect$+", "+szKey$+", "+szSrc$+", "+szDest$
'$endif ''DEBUG

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -