setupapi: Implemented SetupEnumInfSectionsA/W.
This commit is contained in:
parent
1f62d85496
commit
b45cfc123e
|
@ -1244,6 +1244,75 @@ void WINAPI SetupCloseInfFile( HINF hinf )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* SetupEnumInfSectionsA (SETUPAPI.@)
|
||||||
|
*/
|
||||||
|
BOOL WINAPI SetupEnumInfSectionsA( HINF hinf, UINT index, PSTR buffer, DWORD size, DWORD *need )
|
||||||
|
{
|
||||||
|
struct inf_file *file = hinf;
|
||||||
|
|
||||||
|
for (file = hinf; file; file = file->next)
|
||||||
|
{
|
||||||
|
if (index < file->nb_sections)
|
||||||
|
{
|
||||||
|
DWORD len = WideCharToMultiByte( CP_ACP, 0, file->sections[index]->name, -1,
|
||||||
|
NULL, 0, NULL, NULL );
|
||||||
|
if (*need) *need = len;
|
||||||
|
if (!buffer)
|
||||||
|
{
|
||||||
|
if (!size) return TRUE;
|
||||||
|
SetLastError( ERROR_INVALID_USER_BUFFER );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if (len > size)
|
||||||
|
{
|
||||||
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
WideCharToMultiByte( CP_ACP, 0, file->sections[index]->name, -1, buffer, size, NULL, NULL );
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
index -= file->nb_sections;
|
||||||
|
}
|
||||||
|
SetLastError( ERROR_NO_MORE_ITEMS );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* SetupEnumInfSectionsW (SETUPAPI.@)
|
||||||
|
*/
|
||||||
|
BOOL WINAPI SetupEnumInfSectionsW( HINF hinf, UINT index, PWSTR buffer, DWORD size, DWORD *need )
|
||||||
|
{
|
||||||
|
struct inf_file *file = hinf;
|
||||||
|
|
||||||
|
for (file = hinf; file; file = file->next)
|
||||||
|
{
|
||||||
|
if (index < file->nb_sections)
|
||||||
|
{
|
||||||
|
DWORD len = strlenW( file->sections[index]->name ) + 1;
|
||||||
|
if (*need) *need = len;
|
||||||
|
if (!buffer)
|
||||||
|
{
|
||||||
|
if (!size) return TRUE;
|
||||||
|
SetLastError( ERROR_INVALID_USER_BUFFER );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if (len > size)
|
||||||
|
{
|
||||||
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
memcpy( buffer, file->sections[index]->name, len * sizeof(WCHAR) );
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
index -= file->nb_sections;
|
||||||
|
}
|
||||||
|
SetLastError( ERROR_NO_MORE_ITEMS );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* SetupGetLineCountA (SETUPAPI.@)
|
* SetupGetLineCountA (SETUPAPI.@)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -389,6 +389,8 @@
|
||||||
@ stub SetupDiUnremoveDevice
|
@ stub SetupDiUnremoveDevice
|
||||||
@ stub SetupDuplicateDiskSpaceListA
|
@ stub SetupDuplicateDiskSpaceListA
|
||||||
@ stub SetupDuplicateDiskSpaceListW
|
@ stub SetupDuplicateDiskSpaceListW
|
||||||
|
@ stdcall SetupEnumInfSectionsA(long long ptr long ptr)
|
||||||
|
@ stdcall SetupEnumInfSectionsW(long long ptr long ptr)
|
||||||
@ stdcall SetupFindFirstLineA(long str str ptr)
|
@ stdcall SetupFindFirstLineA(long str str ptr)
|
||||||
@ stdcall SetupFindFirstLineW(long wstr wstr ptr)
|
@ stdcall SetupFindFirstLineW(long wstr wstr ptr)
|
||||||
@ stdcall SetupFindNextLine(ptr ptr)
|
@ stdcall SetupFindNextLine(ptr ptr)
|
||||||
|
|
|
@ -1633,8 +1633,8 @@ BOOL WINAPI SetupDiUnremoveDevice(HDEVINFO, PSP_DEVINFO_DATA);
|
||||||
HDSKSPC WINAPI SetupDuplicateDiskSpaceListA(HDSKSPC, PVOID, DWORD, UINT);
|
HDSKSPC WINAPI SetupDuplicateDiskSpaceListA(HDSKSPC, PVOID, DWORD, UINT);
|
||||||
HDSKSPC WINAPI SetupDuplicateDiskSpaceListW(HDSKSPC, PVOID, DWORD, UINT);
|
HDSKSPC WINAPI SetupDuplicateDiskSpaceListW(HDSKSPC, PVOID, DWORD, UINT);
|
||||||
#define SetupDuplicateDiskSpaceList WINELIB_NAME_AW(SetupDuplicateDiskSpaceList)
|
#define SetupDuplicateDiskSpaceList WINELIB_NAME_AW(SetupDuplicateDiskSpaceList)
|
||||||
BOOL WINAPI SetupEnumInfSectionsA(HINF, UINT, PSTR, SIZE, UINT *);
|
BOOL WINAPI SetupEnumInfSectionsA(HINF, UINT, PSTR, DWORD, DWORD *);
|
||||||
BOOL WINAPI SetupEnumInfSectionsW(HINF, UINT, PWSTR, SIZE, UINT *);
|
BOOL WINAPI SetupEnumInfSectionsW(HINF, UINT, PWSTR, DWORD, DWORD *);
|
||||||
#define SetupEnumInfSections WINELIB_NAME_AW(SetupEnumInfSections)
|
#define SetupEnumInfSections WINELIB_NAME_AW(SetupEnumInfSections)
|
||||||
BOOL WINAPI SetupFindFirstLineA( HINF hinf, PCSTR section, PCSTR key, INFCONTEXT *context );
|
BOOL WINAPI SetupFindFirstLineA( HINF hinf, PCSTR section, PCSTR key, INFCONTEXT *context );
|
||||||
BOOL WINAPI SetupFindFirstLineW( HINF hinf, PCWSTR section, PCWSTR key, INFCONTEXT *context );
|
BOOL WINAPI SetupFindFirstLineW( HINF hinf, PCWSTR section, PCWSTR key, INFCONTEXT *context );
|
||||||
|
|
Loading…
Reference in New Issue