Jump to content

Driver Installation in Device Manager (yellow Explanation Mark)


kulkarniquiet
 Share

Recommended Posts

Hi All,

Need urgent help. We have console based driver installation EXE which is developed through DDK API.

On my PC two network adapter card inserted (D-Link) in two PCI slot.

When i am installing both Network Adapetr PCI Ethernet throgh my application, It install driver properly.

But in Device manager it shows 2 Network Adpater Card (D-Link) properly installed

but one extra Network Adpater Card(D-Link) entry is there with yellow mark (black exclamation) [This device cannot start. (Code 10)].

Why this third extra driver entry viewing in Device manager.

Entry in Device Manager :

1. D-Link DGE-530T Gigabit Ethernet Adapter

2. D-Link DGE-530T Gigabit Ethernet Adapter # 2

3. D-Link DGE-530T Gigabit Ethernet Adapter #15 (With Yellow,black exclamation mark) Location : Unknown

Is there any other API need to call before UpdateDriverForPlugAndPlayDevices().

How to select device to install in particular PCI slot.

Or is there any API which takes Location like PCI Slot 3 (PCI bus 4, device 2, function 0).

And install driver for that location.

Any suggestion or even reply most welcome.

Please reply soon.

/******************************************************************************

* Name : InstallClassDriver

* Description : Function install driver for each device information.

* Input Parameters : None

* Output Parameters : None

* Return Value : BOOL

******************************************************************************/

BOOL CDriverInstaller::InstallClassDriver()

{

GUID guid = {0};

SP_DEVINFO_DATA spDevData = {0};

HDEVINFO hDevInfo = 0L;

char l_chClassName[MAX_CLASS_NAME_LEN] = {0};

char *pHID = 0L;

short wLoop = 0;

BOOL bRebootRequired = FALSE;

CErrorDisplay l_ErrMsg;

/* Get the class of a specified Windows NT 4.0-style INF file */

if (SetupDiGetINFClass(m_csINFPath, &guid, l_chClassName, MAX_CLASS_NAME_LEN, 0) != TRUE){

l_ErrMsg.DisplayError("SetupDiGetINFClass",GetLastError());

return(FALSE);

};

/* Create an empty device information set */

hDevInfo = SetupDiCreateDeviceInfoList(&guid, 0);

if (hDevInfo == INVALID_HANDLE_VALUE){

l_ErrMsg.DisplayError("SetupDiCreateDeviceInfoList",GetLastError());

return(FALSE);

};

spDevData.cbSize = sizeof(SP_DEVINFO_DATA);

/* Create a new device information element and add it as a new member to the specified device information set */

if (SetupDiCreateDeviceInfo(hDevInfo,l_chClassName,&guid,0L, 0L, DICD_GENERATE_ID,&spDevData) != TRUE){

l_ErrMsg.DisplayError("SetupDiCreateDeviceInfo",GetLastError());

SetupDiDestroyDeviceInfoList(hDevInfo);

return(FALSE);

};

for (wLoop = 0; wLoop < m_carrHardWareID.GetSize(); ++wLoop){

if (pHID){

LocalFree(pHID);

}

/* Allocate the specified number of bytes from the heap */

pHID = (char*)LocalAlloc(LPTR, strlen(m_carrHardWareID.GetAt(wLoop))*HDWARE_ID*sizeof(char));

if (!pHID){

l_ErrMsg.DisplayError("LocalAlloc",GetLastError());

SetupDiDestroyDeviceInfoList(hDevInfo);

return(FALSE);

};

strcpy(pHID, m_carrHardWareID.GetAt(wLoop));

/* Set the specified device registry property */

if (SetupDiSetDeviceRegistryProperty(hDevInfo,

&spDevData,

SPDRP_HARDWAREID,

(PBYTE)pHID,

(DWORD)(strlen(m_carrHardWareID.GetAt(wLoop))*HDWARE_ID*sizeof(char))) != TRUE){

l_ErrMsg.DisplayError("SetupDiSetDeviceRegistryProperty",GetLastError());

SetupDiDestroyDeviceInfoList(hDevInfo);

LocalFree(pHID);

return(FALSE);

};

/* Call the appropriate class installer with the specified installation request (DI_FUNCTION) */

if (SetupDiCallClassInstaller(DIF_REGISTERDEVICE,hDevInfo, &spDevData) != TRUE){

l_ErrMsg.DisplayError("SetupDiCallClassInstaller",GetLastError());

SetupDiDestroyDeviceInfoList(hDevInfo);

LocalFree(pHID);

return(FALSE);

};

printf("\n Installing or updating driver for device: %s",m_carrHardWareID.GetAt(wLoop));

bRebootRequired = 0;

/* Install updated drivers for devices that match the hardware ID */

if (UpdateDriverForPlugAndPlayDevices(0L,

m_carrHardWareID.GetAt(wLoop),

m_csINFPath,

INSTALLFLAG_FORCE,

&bRebootRequired) != TRUE){

l_ErrMsg.DisplayError("UpdateDriverForPlugAndPlayDevices",GetLastError());

if (SetupDiCallClassInstaller(DIF_REMOVE, hDevInfo, &spDevData) != TRUE){

SetupDiDestroyDeviceInfoList(hDevInfo);

}

LocalFree(pHID);

return(FALSE);

};

LocalFree(pHID);

pHID = 0L;

};

/* Destroy a device information set and frees all associated memory */

SetupDiDestroyDeviceInfoList(hDevInfo);

printf("\n\n \t Driver Installation Successfully Completed\n\n\n\n");

return(TRUE);

};

Link to comment
Share on other sites


hmm... sounds like to me the .exe doesnt like the machine you are trying to install the drivers on.

what i would do personally is find the drivers for the 2 network cards online, uninstall all 3 drivers listed from device manager, then reboot the machine, when your system detects the new hardware on reboot, dont install the drivers automatically, install them manually then point it to the folders where you have the drivers you downloaded.

installing from a .exe is pretty hard when it doesnt work for you. let me know if that doesnt work for you or if you have to use the .exe for some reason try and figure something else out

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.


×
×
  • Create New...