Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than difxapi, prefix the name with the module name and a period.
DriverPackageGetPath (difxapi)
.
C# Signature:
[DllImport("DIFxAPI.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern Int32 DriverPackageGetPath([MarshalAs(UnmanagedType.LPTStr)] string DriverPackageInfPath, [MarshalAs(UnmanagedType.LPTStr)] string pDestInfPath, out Int32 pNumOfChars);
VB Signature:
Public Declare Auto Function DriverPackageGetPath Lib "DIFxAPI.dll" (ByVal DriverPackageInfPath As String, ByVal pDestInfPath As String, ByRef pNumOfChars As Int32) As Int32
User-Defined Types:
None.
Alternative Managed API:
Do you know one? Please contribute it!
Notes:
I was unable to get the C# Signature above to work but this worked fine.
[DllImport("DIFxAPI.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern Int32 DriverPackageGetPath(
[MarshalAs(UnmanagedType.LPTStr)]
string DriverPackageInfPath,
StringBuilder pDestInfPath,
out Int32 pNumOfChars
Tips & Tricks:
To use this function you just need difxapi.dll of appropriate architecture from Windows Server 2008/Vista WDK. The DriverStore will be created automatically for you.
Const ERROR_INSUFFICIENT_BUFFER As Int32 = 122
Dim infFile As String = <INF_file_name>
Dim infDriverStorePathLength As Int32 = 256
Dim infDriverStorePath As String = String.Empty
infDriverStorePath = infDriverStorePath.PadLeft(infDriverStorePathLength - 1)
Dim GetPathResult As Int32 = DriverPackageGetPath(infFile, infDriverStorePath, infDriverStorePathLength)
If GetPathResult = ERROR_INSUFFICIENT_BUFFER Then
infDriverStorePath = infDriverStorePath.PadLeft(infDriverStorePathLength - 1)
GetPathResult = DriverPackageGetPath(infFile, infDriverStorePath, infDriverStorePathLength)
End If
The DriverPackageGetPath function retrieves the fully qualified path of the driver store INF file for a preinstalled driver package.
11/19/2010 11:08:45 AM - Andriy Klyuchevskyy-131.107.0.103
TODO - a short description
3/2/2014 11:52:51 PM - anonymous
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).