[This function is available for use in the operating systems indicated in the Requirements section. It may be altered or unavailable in subsequent versions. SetupAPI should no longer be used for installing applications. Instead, use the Windows Installer for developing application installers. SetupAPI continues to be used for installing device drivers.]
The SetupGetSourceFileSize function reads the uncompressed size of a source file listed in an INF file.
BOOL SetupGetSourceFileSize( __in HINF InfHandle, __in PINFCONTEXT InfContext, __in PCTSTR FileName, __in PCTSTR Section, __inout PDWORD FileSize, __in UINT RoundingFactor );
- InfHandle [in]
Handle to the loaded INF file that contains the SourceDisksNames and SourceDisksFiles sections. If platform-specific sections exist for the user's system (for example, SourceDisksNames.x86 and SourceDisksFiles.x86), the platform-specific section will be used.
- InfContext [in]
Optional pointer to a context for a line in a Copy Files section for which the size is to be retrieved. If InfContext is NULL, the FileName parameter is used.
- FileName [in]
Optional pointer to a null-terminated string containing the filename (no path) for which to return the size. If this parameter is NULL as well as InfContext, then the Section parameter is used.
- Section [in]
Optional pointer to a null-terminated string containing the name of a Copy Files section. If this parameter is specified, the total size of all files listed in the section is computed.
- FileSize [in, out]
Pointer to a variable that receives the size, in bytes, of the specified file(s).
- RoundingFactor [in]
Optional value for rounding file sizes. All file sizes are rounded up to a multiple of this number before being added to the total size. Rounding is useful for more exact determinations of the space that a file will occupy on a given volume, because it allows the caller to have file sizes rounded up to a multiple of the cluster size. Rounding does not occur unless RoundingFactor is specified.
If the function succeeds, the return value is a nonzero value.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
One and only one of the optional parameters, InfContext, FileName, and Section, must be specified.
Minimum supported client
|Windows 2000 Professional|
Minimum supported server
|Windows 2000 Server|
Unicode and ANSI names
|SetupGetSourceFileSizeW (Unicode) and SetupGetSourceFileSizeA (ANSI)|
Build date: 8/19/2010