My driver is a "non plug and play driver"?

Hi all,
I did a little modify to use the sample code “disk” as my own device driver. But after installed, the driver is under the list “non plug and play drivers” in the device manager, and my device will have a yellow excalmatory mark. I only did a little name replace What may cause this problem?
Thanks & regards.

How did you install the driver?

d

dent from a phine with no keynoard

-----Original Message-----
From: kuangnuzhiren@163.com
Sent: Sunday, March 06, 2011 6:15 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] My driver is a “non plug and play driver”?

Hi all,
I did a little modify to use the sample code “disk” as my own device driver. But after installed, the driver is under the list “non plug and play drivers” in the device manager, and my device will have a yellow excalmatory mark. I only did a little name replace What may cause this problem?
Thanks & regards.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

{
BOOL bReboot = FALSE;
DWORD dwError = NO_ERROR;
PBYTE pDeviceList = NULL;
DWORD dwBytes = 0;

//
// Simply pre-copy the INF file for future paths. Setup will take care of the rest
//
if (SetupCopyOEMInf(InfFile, NULL, SPOST_PATH, 0, NULL, 0, NULL, NULL)) {

//
// Obtain the list of devices that are supported for multi-path
//
dwError = GetRegistryMultiSZ(INST_DSM, &pDeviceList, &dwBytes);

if (dwError == NO_ERROR) {

TCHAR* pIndex = NULL;

//
// For every string, convert the spaces to underscores
//
for (pIndex = (TCHAR*)pDeviceList; *pIndex; pIndex += _tcslen(pIndex) + 1) {

DWORD nIndex = 0;

for (nIndex = 0; nIndex < _tcslen(pIndex); nIndex++) {

if (*(pIndex + nIndex) == SPACE) {
*(pIndex + nIndex) = UNDERSCORE;
}
}
}

//
// For any path that already exists, manually update its hardware id
//
dwError = EnumerateDevices(&GUID_DEVCLASS_DISKDRIVE, UpdateDiskHardwareID, pDeviceList, &bReboot);

if (dwError == NO_ERROR) {

//
// Restart all devices that are part of a multi-path
//
if (UpdateDriverForPlugAndPlayDevices(0, MYDISK_HARDWAREID, InfFile, 0, &bReboot)) {

//
// The devices were successfully restarted
//

} else {

dwError = GetLastError();

if (dwError == ERROR_NO_SUCH_DEVINST) {

//
// None of the paths are currently connected
//
dwError = NO_ERROR;
}
}
}

if (pDeviceList) {
LocalFree(pDeviceList);
}

}

} else {
_tprintf(TEXT(“SetupCopyOEMInf failed.”));

dwError = GetLastError();
}

if (dwError == NO_ERROR) {

//
// Update only if a reboot hasn’t already been requested
//
if (*RebootRequired == FALSE) {
*RebootRequired = bReboot;
}

_tprintf(TEXT(“Success %s\n”), (bReboot) ? TEXT(“(but need a reboot)”) : TEXT(“”));

} else {
_tprintf(TEXT(“Failure in InstallMyDisk.”)); DisplayError(dwError);
}

return dwError;
}