Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit abbd336

Browse files
committed
Windows driver installation: Made VBoxWinDrvInfQueryCopyFiles() a little easier to use.
svn:sync-xref-src-repo-rev: r171248
1 parent 428b43f commit abbd336

File tree

3 files changed

+22
-18
lines changed

3 files changed

+22
-18
lines changed

‎src/VBox/GuestHost/installation/VBoxWinDrvCommon.cpp‎

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Id: VBoxWinDrvCommon.cpp 111640 2025-11-11 16:28:40Z andreas.loeffler@oracle.com $ */
1+
/* $Id: VBoxWinDrvCommon.cpp 111656 2025-11-12 10:53:57Z andreas.loeffler@oracle.com $ */
22
/** @file
33
* VBoxWinDrvCommon - Common Windows driver installation functions.
44
*/
@@ -697,16 +697,19 @@ static int vboxWinDrvInfQueryCopyFilesSingle(HINF hInf, INFCONTEXT infCtxSection
697697
/**
698698
* Queries the CopyFile directives in a given INF file section.
699699
*
700-
* @returns VBox status code.
700+
* @returns VBox status code. VERR_NOT_FOUND if no entries were found.
701701
* @param pCtx Windows driver installer context.
702702
* @param pwszSection Section in INF file to query the CopyFile directives for.
703-
* @param pCopyFiles Where to store the queried entries on success.
704-
* Must be initialized by the caller.
703+
* @param ppCopyFiles Where to return the allocated list of the entries on success.
704+
* Must be destroyed with VBoxWinDrvInfListDestroy().
705705
*/
706-
int VBoxWinDrvInfQueryCopyFiles(HINF hInf, PRTUTF16 pwszSection, PVBOXWINDRVINFLIST pCopyFiles)
706+
int VBoxWinDrvInfQueryCopyFiles(HINF hInf, PRTUTF16 pwszSection, PVBOXWINDRVINFLIST *ppCopyFiles)
707707
{
708708
int rc = VINF_SUCCESS;
709709

710+
PVBOXWINDRVINFLIST pCopyFiles = VBoxWinDrvInfListCreate(VBOXWINDRVINFLISTENTRY_T_COPYFILE);
711+
AssertPtrReturn(pCopyFiles, VERR_NO_MEMORY);
712+
710713
/*
711714
* Process all "CopyFiles" directives found in the section.
712715
*/
@@ -719,6 +722,16 @@ int VBoxWinDrvInfQueryCopyFiles(HINF hInf, PRTUTF16 pwszSection, PVBOXWINDRVINFL
719722
} while (RT_SUCCESS(rc) && SetupFindNextMatchLineW(&infCtxCopyFiles, L"CopyFiles", &infCtxCopyFiles)); /* Process next CopyFile directive. */
720723
}
721724

725+
if (RT_SUCCESS(rc))
726+
{
727+
if (pCopyFiles->cEntries)
728+
*ppCopyFiles = pCopyFiles;
729+
else
730+
rc = VERR_NOT_FOUND;
731+
}
732+
733+
if (RT_FAILURE(rc))
734+
VBoxWinDrvInfListDestroy(pCopyFiles);
722735
return rc;
723736
}
724737

‎src/VBox/GuestHost/installation/VBoxWinDrvCommon.h‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Id: VBoxWinDrvCommon.h 111636 2025-11-11 15:47:46Z andreas.loeffler@oracle.com $ */
1+
/* $Id: VBoxWinDrvCommon.h 111656 2025-11-12 10:53:57Z andreas.loeffler@oracle.com $ */
22
/** @file
33
* VBoxWinDrvCommon - Common Windows driver functions.
44
*/
@@ -82,7 +82,7 @@ int VBoxWinDrvInfClose(HINF hInf);
8282
PRTUTF16 VBoxWinDrvInfGetPathFromId(unsigned idDir, PCRTUTF16 pwszSubDir);
8383
VBOXWINDRVINFTYPE VBoxWinDrvInfGetTypeEx(HINF hInf, PRTUTF16 *ppwszSection);
8484
VBOXWINDRVINFTYPE VBoxWinDrvInfGetType(HINF hInf);
85-
int VBoxWinDrvInfQueryCopyFiles(HINF hInf, PRTUTF16 pwszSection, PVBOXWINDRVINFLIST pCopyFiles);
85+
int VBoxWinDrvInfQueryCopyFiles(HINF hInf, PRTUTF16 pwszSection, PVBOXWINDRVINFLIST *ppCopyFiles);
8686
int VBoxWinDrvInfQueryFirstModel(HINF hInf, PCRTUTF16 pwszSection, PRTUTF16 *ppwszModel);
8787
int VBoxWinDrvInfQueryFirstPnPId(HINF hInf, PRTUTF16 pwszModel, PRTUTF16 *ppwszPnPId);
8888
int VBoxWinDrvInfQueryKeyValue(PINFCONTEXT pCtx, DWORD iValue, PRTUTF16 *ppwszValue, PDWORD pcwcValue);
@@ -92,7 +92,6 @@ int VBoxWinDrvInfQueryParms(HINF hInf, PVBOXWINDRVINFPARMS pParms, bool fForce);
9292
int VBoxWinDrvInfQuerySectionKeyByIndex(HINF hInf, PCRTUTF16 pwszSection, PRTUTF16 *ppwszValue, PDWORD pcwcValue);
9393
int VBoxWinDrvInfQuerySectionVerEx(HINF hInf, UINT uIndex, PVBOXWINDRVINFSECVERSION pVer);
9494
int VBoxWinDrvInfQuerySectionVer(HINF hInf, PVBOXWINDRVINFSECVERSION pVer);
95-
int VBoxWinDrvInfQueryCopyFiles(HINF hInf, PVBOXWINDRVINFLIST pCopyFiles);
9695
bool VBoxWinDrvInfSectionExists(HINF hInf, PCRTUTF16 pwszSection);
9796

9897
PVBOXWINDRVINFLIST VBoxWinDrvInfListCreate(VBOXWINDRVINFLISTENTRY_T enmType);

‎src/VBox/GuestHost/installation/VBoxWinDrvStore.cpp‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Id: VBoxWinDrvStore.cpp 111636 2025-11-11 15:47:46Z andreas.loeffler@oracle.com $ */
1+
/* $Id: VBoxWinDrvStore.cpp 111656 2025-11-12 10:53:57Z andreas.loeffler@oracle.com $ */
22
/** @file
33
* VBoxWinDrvStore - Windows driver store handling.
44
*/
@@ -425,15 +425,7 @@ static int vboxWinDrvStoreEntryInitFromInf(PVBOXWINDRVSTOREENTRY pEntry, const c
425425
rc = VBoxWinDrvInfQueryParms(hInf, &InfParms, false /* fForce */);
426426
if (RT_SUCCESS(rc))
427427
{
428-
pEntry->pCopyFileList = VBoxWinDrvInfListCreate(VBOXWINDRVINFLISTENTRY_T_COPYFILE);
429-
if (pEntry->pCopyFileList)
430-
{
431-
int rc2 = VBoxWinDrvInfQueryCopyFiles(hInf, InfParms.pwszSection, pEntry->pCopyFileList);
432-
if (RT_SUCCESS(rc))
433-
rc = rc2;
434-
}
435-
else
436-
rc = VERR_NO_MEMORY;
428+
/* ignore rc */ VBoxWinDrvInfQueryCopyFiles(hInf, InfParms.pwszSection, &pEntry->pCopyFileList);
437429
}
438430
else
439431
rc = VERR_INVALID_PARAMETER;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /