Click here to Skip to main content
15,898,222 members
Home / Discussions / Hardware & Devices
   

Hardware & Devices

 
AnswerRe: robotics..... Pin
M.Nouri10-Mar-08 18:41
M.Nouri10-Mar-08 18:41 
GeneralRe: robotics..... Pin
kanza azhar11-Mar-08 3:16
kanza azhar11-Mar-08 3:16 
AnswerRe: robotics..... Pin
M.Nouri11-Mar-08 3:33
M.Nouri11-Mar-08 3:33 
GeneralRe: robotics..... Pin
kanza azhar5-Apr-08 8:37
kanza azhar5-Apr-08 8:37 
GeneralRe: robotics..... Pin
M.Nouri5-Apr-08 22:31
M.Nouri5-Apr-08 22:31 
GeneralExtra driver entries viewed in device manager (with yellow exclamation mark) Pin
Manasi D28-Feb-08 18:28
Manasi D28-Feb-08 18:28 
GeneralRe: Extra driver entries viewed in device manager (with yellow exclamation mark) Pin
fat_boy6-Mar-08 7:22
fat_boy6-Mar-08 7:22 
GeneralRe: Extra driver entries viewed in device manager (with yellow exclamation mark) Pin
Manasi D7-Mar-08 1:52
Manasi D7-Mar-08 1:52 
Thanx for your suggestion.

Device get installed but one more extra device get installed saying "Device is not working properly [Code-10] with Yellow exclamation Mark".

But in my case UpdateDriverForPlugAndPlayDevices() does not fail, it return succes for all Hardware ID and install driver for all hardware ID present in the INF file.

So after completion Device manager->Network Card contains 2 successfully installed PCI card (Which is already connected) but 1 more extra entry of the PCI card (Unkown device) with yellow exclamation mark(Code-10 Device is not working properly).

Do you have any idea.

Plz See my code :

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);
};
GeneralRe: Extra driver entries viewed in device manager (with yellow exclamation mark) Pin
fat_boy7-Mar-08 2:04
fat_boy7-Mar-08 2:04 
GeneralComputer Not Booting.... Pin
aj.esler27-Feb-08 12:14
aj.esler27-Feb-08 12:14 
GeneralRe: Computer Not Booting.... Pin
Sebastian Schneider27-Feb-08 22:36
Sebastian Schneider27-Feb-08 22:36 
AnswerRe: Computer Not Booting.... Pin
M.Nouri12-Mar-08 1:44
M.Nouri12-Mar-08 1:44 
GeneralRe: Computer Not Booting.... Pin
M.Nouri12-Mar-08 3:31
M.Nouri12-Mar-08 3:31 
GeneralNet Problem Pin
Sipder21-Feb-08 20:15
Sipder21-Feb-08 20:15 
QuestionRe: Net Problem Pin
Maxwell Chen21-Feb-08 21:18
Maxwell Chen21-Feb-08 21:18 
GeneralModem [modified] Pin
messages21-Feb-08 4:54
messages21-Feb-08 4:54 
QuestionHow do we share scanner on network? Pin
Hy Chanhan20-Feb-08 15:14
professionalHy Chanhan20-Feb-08 15:14 
AnswerRe: How do we share scanner on network? Pin
Dave Kreskowiak21-Feb-08 3:14
mveDave Kreskowiak21-Feb-08 3:14 
GeneralRe: How do we share scanner on network? Pin
Hy Chanhan21-Feb-08 14:12
professionalHy Chanhan21-Feb-08 14:12 
GeneralRe: How do we share scanner on network? Pin
Dave Kreskowiak22-Feb-08 1:08
mveDave Kreskowiak22-Feb-08 1:08 
AnswerRe: How do we share scanner on network? Pin
Sebastian Schneider25-Feb-08 0:58
Sebastian Schneider25-Feb-08 0:58 
GeneralRe: How do we share scanner on network? Pin
Sebastian Schneider25-Feb-08 1:02
Sebastian Schneider25-Feb-08 1:02 
Generalproblems with PREfast Pin
Waldermort19-Feb-08 5:53
Waldermort19-Feb-08 5:53 
GeneralRe: problems with PREfast Pin
fat_boy19-Feb-08 6:38
fat_boy19-Feb-08 6:38 
GeneralRe: problems with PREfast Pin
Waldermort19-Feb-08 8:05
Waldermort19-Feb-08 8:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.