0

Okay, So I am getting this weird error stating "ERROR_NO_CATALOG_FOR_OEM_INF" whenever I call DiInstallDevice, InstallSelectedDriver. The error code returned is 3758096943. When I look it up in err.exe, it says

# for decimal -536870353 / hex 0xe000022f :
  ERROR_NO_CATALOG_FOR_OEM_INF                                  setupapi.h
# for hex 0xffffffff / decimal -1 :
  NO_TITLE                                                      ftsiface.h
  USE_DEFAULT                                                   ftsiface.h
  JET_wrnNyi                                                    esent98.h
# /* Function Not Yet Implemented */
  LZERROR_BADINHANDLE                                           lzexpand.h
# /* invalid input handle */
  MAPI_DIAG_NO_DIAGNOSTIC                                       mapidefs.h
  MSIDBERROR_FUNCTIONERROR                                      msiquery.h
# function error
  ERROR_UNHANDLED_ERROR                                         ntddchgr.h
# Unknown error condition
  PDR_ERROR                                                     penwin.h
# parameter or unspecified error
  ICERR_UNSUPPORTED                                             vfw.h
  ERROR_UNHANDLED_ERROR                                         winioctl.h
# Unknown error condition
# 11 matches found for "3758096943"

I am using setupapi, therefore the error, Internet searches reveal nothing whatsoever apart from the error being associated with the "SetupCopyOEMInf()" Which I have no relation to. The Driver in Question is an Intel HD 520 Signed Driver. I have verified it and downloaded it via Microsoft update catalog.

The driver is Selected using SetupDiSetSelectedDriver() and the correct device is selected using SetupDiSetSelectedDevice(). If anyone can point me in the right direction itwould be great!.

Code :

PopulateDeviceInstaceIds(L"PCI\\VEN_8086&DEV_1916");
            SP_DRVINFO_DATA drvData;
            SP_DRVINFO_DETAIL_DATA drvDetailData;
            SP_DEVINFO_DATA LocDevData;
            MakeDevClassHandles(handle,instancesOfDevice.at(0).c_str());
            SetDRVINFO(&LocDevData,&drvDetailData,&drvData,L"Intel Corporation",L"22.20.16.4836",TRUE);
            std::cout<<SetupDiSetSelectedDevice(handle,&LocDevData)<<endl;
            std::cout<<SetupDiSetSelectedDriver(handle,&LocDevData,&drvData)<<endl;
            if(&drvData!=NULL)
            {
                HMODULE libHandle = LoadLibraryW(L"newdev.dll");
                lpfnInstallSelectedDriver addr;
                DWORD rebootRec;
                addr = (lpfnInstallSelectedDriver)GetProcAddress(libHandle,"InstallSelectedDriver");
                if(addr!=NULL && addr(NULL,handle,NULL,TRUE,&rebootRec))
                {

                }
                else
                    cout<<"InstallSelectedDriver ERR : "<<GetLastError();
                 if(DiInstallDevice(NULL,handle,&LocDevData,&drvData,0,&nRebo))
                {

                }
                else
                {
                    cout<<"DiInstall Device error : "<<GetLastError();
                    std::cout<<"\n\nWaiting for upto 10 seconds for changes to reflect..";
                    Sleep(10000);

I guess this code will be enough, if not please let me know. The entire code is a few hundred lines, so.

The SetDRVINFO() function just sets the correct device and driver in the structures, i have verified them while debugging. Both the else cases throw the same error.

Suraj S
  • 1,019
  • 7
  • 18
  • The error code `3758096943` does not match `ERROR_NO_CATALOG_FOR_OEM_INF`. Please show the code you use to determine the error code. – IInspectable Feb 14 '18 at 13:33
  • @IInspectable Added code, and how do you tell the error code does not match, I used err.exe to find it. – Suraj S Feb 14 '18 at 13:42
  • Interesting, when I build the exe in x64, I do not get the error, Everything works as it should. But should it not throw ERROR_IN_WOW64 instead of ERROR_NO_CATALOG_FOR_OEM_INF ???? – Suraj S Feb 14 '18 at 14:18
  • @IInspectable actually it does: `ERROR_NO_CATALOG_FOR_OEM_INF` is defined as `(APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x22F)`, `APPLICATION_ERROR_MASK` is `0x20000000`, and `ERROR_SEVERITY_ERROR` is `0xC0000000`, which gives us `0x20000000|0xC0000000|0x22F` == `0xE000022F` == `3758096943`. (Yes, I know; I'm surprised it's not a standard Windows error code too.) – andlabs Feb 14 '18 at 19:56
  • @andlabs: Actually, that's `-536870353`. `NTSTATUS` values are signed. – IInspectable Feb 14 '18 at 23:28

0 Answers0