The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Magnum on September 02, 2010, 02:01:28 AM

Title: Command option flags
Post by: Magnum on September 02, 2010, 02:01:28 AM
I can't find any info regarding the command option flags.

VOID RemoveFile(LPSTR szFullPathSrc, INT cmo);

RemoveFile deletes the specified file.

Arguments

szFullPathSrc

Specifies the full path of the file you want to delete.

cmo

Specifies the command option flag. You can use cmoVital, cmoForce, or cmoNone.
Title: Re: Command option flags
Post by: bomz on September 02, 2010, 02:22:43 AM
http://msdn.microsoft.com/en-us/library/aa728634(VS.71).aspx
Quote
The RemoveDirectory function deletes an existing empty directory.

BOOL RemoveDirectory(

    LPCTSTR lpPathName    // address of directory to remove 
   );
Quote
The DeleteFile function deletes an existing file.

BOOL DeleteFile(

    LPCTSTR lpFileName    // pointer to name of file to delete 
   );   

http://www.google.ru/webhp?hl=ru#hl=ru&source=hp&q=VOID+RemoveFile(LPSTR+szFullPathSrc%2C+INT+cmo)&btnG=%D0%9F%D0%BE%D0%B8%D1%81%D0%BA+%D0%B2+Google&aq=f&aqi=&aql=&oq=&gs_rfai=&fp=ff4c4dd44bafad27
Title: Re: Command option flags
Post by: clive on September 02, 2010, 02:32:54 AM
Isn't this related to SETUPAPI and MSI?

http://support.microsoft.com/kb/89572
http://msdn.microsoft.com/en-us/library/aa368596%28VS.85%29.aspx

I seem to think that VITAL means the file has been marked/tracked as required for operation (and would otherwise resist deletion), and FORCE means the file will be deleted (ie overcoming read-only, or in use)
Title: Re: Command option flags
Post by: Magnum on September 02, 2010, 02:33:05 PM
I think RemoveFile has been abandoned or no longer supported.

I get an undefined symbol when I try to compile it.
Title: Re: Command option flags
Post by: clive on September 02, 2010, 04:51:38 PM
To reiterate, this is part of SETUPAPI.INC used in Microsoft's scripted setup, it was not a Win32 API function as far as I'm aware. It probably migrated into MSI, but I haven't messed with any of that stuff in ages.

http://cd.textfiles.com/waycool/SETUPAPI.INC

DECLARE FUNCTION YnrcRemoveFile LIB "msinsstf.dll" (szFullPathSrc$, cmo%) AS INTEGER

DECLARE SUB RemoveFile (szFullPathSrc$, cmo%)


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