Append .DRV to name only if no extension present.
This commit is contained in:
parent
7d64d7d1d7
commit
5138a35295
|
@ -167,10 +167,15 @@ LOADED_PRINTER_DRIVER *LoadPrinterDriver(const char *pszDriver)
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
char *drvName = malloc(strlen(pszDriver)+5);
|
char *p, *drvName = HeapAlloc(GetProcessHeap(), 0, strlen(pszDriver) + 5);
|
||||||
strcpy(drvName, pszDriver);
|
strcpy(drvName, pszDriver);
|
||||||
|
|
||||||
|
/* Append .DRV to name if no extension present */
|
||||||
|
if (!(p = strrchr(drvName, '.')) || strchr(p, '/') || strchr(p, '\\'))
|
||||||
strcat(drvName, ".DRV");
|
strcat(drvName, ".DRV");
|
||||||
|
|
||||||
hInst = LoadLibrary16(drvName);
|
hInst = LoadLibrary16(drvName);
|
||||||
|
HeapFree(GetProcessHeap(), 0, drvName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue