)]
        public static extern UInt32 WerReportSetParameter(IntPtr reportHandle, UInt32 paramID, [MarshalAs(UnmanagedType.LPWStr)] string paramName, [MarshalAs(UnmanagedType.LPWStr)] string paramValue);

        [DllImport("Wer.dll", EntryPoint = "WerReportSubmit", CharSet = CharSet.Unicode, SetLastError = true)]
        public static extern UInt32 WerReportSubmit(IntPtr reportHandle, WER_CONSENT consent, UInt32 flags, ref WER_SUBMIT_RESULT submitResult);

        [DllImport("Wer.dll", EntryPoint = "WerpSetCallBack", CharSet = CharSet.Unicode, SetLastError = true)]
        public static extern UInt32 WerpSetCallBack(IntPtr reportHandle, WERCallBackDelegate callbackDelegate, IntPtr handle);

        [DllImport("Wer.dll", EntryPoint = "WerReportCloseHandle", CharSet = CharSet.Unicode, SetLastError = true)]
        public static extern UInt32 WerReportCloseHandle(IntPtr reportHandle);

        [DllImport("Wer.dll", EntryPoint = "WerpGetStoreLocation", CharSet = CharSet.Unicode, SetLastError = true)]
        public static extern UInt32 WerpGetStoreLocation(IntPtr reportHandle, IntPtr storePath, ref UInt32 pathLength);

        [DllImport("Wer.dll", EntryPoint = "WerpGetStoreType", CharSet = CharSet.Unicode, SetLastError = true)]
        public static extern UInt32 WerpGetStoreType(IntPtr reportHandle, ref REPORT_STORE_TYPES storeType);

        [DllImport("werconcpl.dll", EntryPoint = "WerpIsResponseApplicable", CharSet = CharSet.Unicode, SetLastError = true)]
        public static extern UInt32 WerpIsResponseApplicable([MarshalAs(UnmanagedType.LPWStr)] string reportPath, UInt32 reportType, UInt32 responseAction, ref int isApplicable, ref int isAutoLaunch);


        public static QueryResult QueryWERResponse(string Platform, string PNPDeviceID)
        {
            UInt32 resultCode = 0;
            UInt32 length = MAX_PATH;

            IntPtr reporthandle = IntPtr.Zero;
            IntPtr reportStorePathPtr = IntPtr.Zero;
            string reportStorePath = string.Empty;

        # Copyright  2008, Microsoft Corporation. All rights reserved.


#TS_DriverNotFound
PARAM($DeviceID, $Action)

Import-LocalizedData -BindingVariable localizationString -FileName CL_LocalizationData

. .\DB_DeviceErrorLibrary.ps1
. .\CL_Utility.ps1

$RootCauseAdded = $false
Write-DiagProgress -activity $localizationString.Troubleshoot_DriverNotFound

$ProblemDevice = Get-WmiObject -Class Win32_PnPEntity | Where-Object -FilterScript {$_.DeviceID -eq $DeviceID}

if(($ProblemDevice -ne $Null) -and ($ProblemDevice.ConfigManagerErrorCode -ne $Null))
{
    [string]$DeviceName = $ProblemDevice.Name
    [string]$ErrorCode = $ProblemDevice.ConfigManagerErrorCode
    [bool]$NoDriver = $False

    if ([String]::IsNullOrEmpty($DeviceName))
    {
        $DeviceName = $localizationString.UnknownDevice
    }

    if($HashDriverNotFound.Contains($ErrorCode) -eq $True)
    {
        $NoDriver = $True
    }
    elseif ($ErrorCode -eq "0")
    {
        $NoDriver = DriverNotFound $DeviceID
    }

    if ($NoDriver -eq $True)
    {
        Update-DiagRootCause -id RC_DriverNotFound -iid $DeviceID -Detected $true -p @{'DeviceName'= $DeviceName; 'DeviceID'= $DeviceID}
        $ProblemDevice | Select-Object -Property @{Name=$localizationString.DeviceName; Expression={$_.Name}}, @{Name=$localizationString.PnPDeviceID; Expression={$_.PNPDeviceID}}, @{Name=$localizationString.ConfigManagerErrorCode; Expression={$_.ConfigManagerErrorCode}} | ConvertTo-XML | Update-DiagReport -ID DriverProblem -Name $localizationString.Report_Name_ProblemDevice -Verbosity Informational -rid RC_DriverNotFound -riid $DeviceID
        $RootCauseAdded = $True
    }
    else
    {
        if ($Action -eq "Verify")
        {
            Update-DiagRootCause -id RC_DriverNotFound -iid $DeviceID -Detected $false -p @{'DeviceName'= $DeviceName; 'DeviceID'= $DeviceID}
        }
    }
}

return $RootCauseAdded