mirror of
https://github.com/reactos/reactos.git
synced 2025-04-27 17:10:22 +00:00
Specify W suffix when possible
Don't allocate unneeded memory in SetupDiCreateDeviceInfoListExW Replace strings by array of WCHARs svn path=/trunk/; revision=26876
This commit is contained in:
parent
f1a1a96940
commit
8b7099f2cd
7 changed files with 95 additions and 78 deletions
|
@ -30,6 +30,7 @@ static const WCHAR ClassGUID[] = {'C','l','a','s','s','G','U','I','D',0};
|
||||||
static const WCHAR ClassInstall32[] = {'C','l','a','s','s','I','n','s','t','a','l','l','3','2',0};
|
static const WCHAR ClassInstall32[] = {'C','l','a','s','s','I','n','s','t','a','l','l','3','2',0};
|
||||||
static const WCHAR DotServices[] = {'.','S','e','r','v','i','c','e','s',0};
|
static const WCHAR DotServices[] = {'.','S','e','r','v','i','c','e','s',0};
|
||||||
static const WCHAR InterfaceInstall32[] = {'I','n','t','e','r','f','a','c','e','I','n','s','t','a','l','l','3','2',0};
|
static const WCHAR InterfaceInstall32[] = {'I','n','t','e','r','f','a','c','e','I','n','s','t','a','l','l','3','2',0};
|
||||||
|
static const WCHAR SetupapiDll[] = {'s','e','t','u','p','a','p','i','.','d','l','l',0};
|
||||||
static const WCHAR Version[] = {'V','e','r','s','i','o','n',0};
|
static const WCHAR Version[] = {'V','e','r','s','i','o','n',0};
|
||||||
|
|
||||||
typedef BOOL
|
typedef BOOL
|
||||||
|
@ -633,7 +634,7 @@ SetupDiClassNameFromGuidExW(
|
||||||
if (RequiredSize)
|
if (RequiredSize)
|
||||||
*RequiredSize = dwLength / sizeof(WCHAR) + 1;
|
*RequiredSize = dwLength / sizeof(WCHAR) + 1;
|
||||||
|
|
||||||
if (ClassNameSize * sizeof(WCHAR) >= dwLength + sizeof(UNICODE_STRING))
|
if (ClassNameSize * sizeof(WCHAR) >= dwLength + sizeof(UNICODE_NULL))
|
||||||
{
|
{
|
||||||
if (ClassNameSize > sizeof(UNICODE_NULL))
|
if (ClassNameSize > sizeof(UNICODE_NULL))
|
||||||
ClassName[ClassNameSize / sizeof(WCHAR)] = UNICODE_NULL;
|
ClassName[ClassNameSize / sizeof(WCHAR)] = UNICODE_NULL;
|
||||||
|
@ -835,7 +836,7 @@ SetupDiGetClassDescriptionExW(
|
||||||
if (RequiredSize)
|
if (RequiredSize)
|
||||||
*RequiredSize = dwLength / sizeof(WCHAR) + 1;
|
*RequiredSize = dwLength / sizeof(WCHAR) + 1;
|
||||||
|
|
||||||
if (ClassDescriptionSize * sizeof(WCHAR) >= dwLength + sizeof(UNICODE_STRING))
|
if (ClassDescriptionSize * sizeof(WCHAR) >= dwLength + sizeof(UNICODE_NULL))
|
||||||
{
|
{
|
||||||
if (ClassDescriptionSize > sizeof(UNICODE_NULL))
|
if (ClassDescriptionSize > sizeof(UNICODE_NULL))
|
||||||
ClassDescription[ClassDescriptionSize / sizeof(WCHAR)] = UNICODE_NULL;
|
ClassDescription[ClassDescriptionSize / sizeof(WCHAR)] = UNICODE_NULL;
|
||||||
|
@ -1597,7 +1598,7 @@ SetupDiLoadClassIcon(
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Look up icon in setupapi.dll */
|
/* Look up icon in setupapi.dll */
|
||||||
DllName = L"setupapi.dll";
|
DllName = SetupapiDll;
|
||||||
iconIndex = -iconIndex;
|
iconIndex = -iconIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,10 +27,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
|
||||||
static const WCHAR BackSlash[] = {'\\',0};
|
static const WCHAR BackSlash[] = {'\\',0};
|
||||||
static const WCHAR ClassGUID[] = {'C','l','a','s','s','G','U','I','D',0};
|
static const WCHAR ClassGUID[] = {'C','l','a','s','s','G','U','I','D',0};
|
||||||
static const WCHAR Class[] = {'C','l','a','s','s',0};
|
static const WCHAR Class[] = {'C','l','a','s','s',0};
|
||||||
|
static const WCHAR DateFormat[] = {'%','u','-','%','u','-','%','u',0};
|
||||||
static const WCHAR DotCoInstallers[] = {'.','C','o','I','n','s','t','a','l','l','e','r','s',0};
|
static const WCHAR DotCoInstallers[] = {'.','C','o','I','n','s','t','a','l','l','e','r','s',0};
|
||||||
static const WCHAR DotHW[] = {'.','H','W',0};
|
static const WCHAR DotHW[] = {'.','H','W',0};
|
||||||
static const WCHAR DotServices[] = {'.','S','e','r','v','i','c','e','s',0};
|
static const WCHAR DotServices[] = {'.','S','e','r','v','i','c','e','s',0};
|
||||||
static const WCHAR InfDirectory[] = {'i','n','f','\\',0};
|
static const WCHAR InfDirectory[] = {'i','n','f','\\',0};
|
||||||
|
static const WCHAR InstanceKeyFormat[] = {'%','0','4','l','u',0};
|
||||||
|
static const WCHAR VersionFormat[] = {'%','u','.','%','u','.','%','u','.','%','u',0};
|
||||||
|
|
||||||
static const WCHAR REGSTR_DRIVER_DATE[] = {'D','r','i','v','e','r','D','a','t','e',0};
|
static const WCHAR REGSTR_DRIVER_DATE[] = {'D','r','i','v','e','r','D','a','t','e',0};
|
||||||
static const WCHAR REGSTR_DRIVER_DATE_DATA[] = {'D','r','i','v','e','r','D','a','t','e','D','a','t','a',0};
|
static const WCHAR REGSTR_DRIVER_DATE_DATA[] = {'D','r','i','v','e','r','D','a','t','e','D','a','t','a',0};
|
||||||
|
@ -170,7 +173,6 @@ SetupDiCreateDeviceInfoListExW(
|
||||||
IN PVOID Reserved)
|
IN PVOID Reserved)
|
||||||
{
|
{
|
||||||
struct DeviceInfoSet *list;
|
struct DeviceInfoSet *list;
|
||||||
LPWSTR UNCServerName = NULL;
|
|
||||||
DWORD size;
|
DWORD size;
|
||||||
DWORD rc;
|
DWORD rc;
|
||||||
CONFIGRET cr;
|
CONFIGRET cr;
|
||||||
|
@ -206,15 +208,7 @@ SetupDiCreateDeviceInfoListExW(
|
||||||
SetLastError(rc);
|
SetLastError(rc);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
UNCServerName = MyMalloc((strlenW(MachineName) + 3) * sizeof(WCHAR));
|
|
||||||
if (!UNCServerName)
|
|
||||||
{
|
|
||||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
UNCServerName[0] = UNCServerName[1] = '\\';
|
|
||||||
strcpyW(UNCServerName + 2, MachineName);
|
|
||||||
list->szData[0] = list->szData[1] = '\\';
|
list->szData[0] = list->szData[1] = '\\';
|
||||||
strcpyW(list->szData + 2, MachineName);
|
strcpyW(list->szData + 2, MachineName);
|
||||||
list->MachineName = list->szData;
|
list->MachineName = list->szData;
|
||||||
|
@ -224,7 +218,7 @@ SetupDiCreateDeviceInfoListExW(
|
||||||
list->HKLM = HKEY_LOCAL_MACHINE;
|
list->HKLM = HKEY_LOCAL_MACHINE;
|
||||||
list->MachineName = NULL;
|
list->MachineName = NULL;
|
||||||
}
|
}
|
||||||
cr = CM_Connect_MachineW(UNCServerName, &list->hMachine);
|
cr = CM_Connect_MachineW(list->MachineName, &list->hMachine);
|
||||||
if (cr != CR_SUCCESS)
|
if (cr != CR_SUCCESS)
|
||||||
{
|
{
|
||||||
SetLastError(GetErrorCodeFromCrCode(cr));
|
SetLastError(GetErrorCodeFromCrCode(cr));
|
||||||
|
@ -245,7 +239,6 @@ cleanup:
|
||||||
MyFree(list);
|
MyFree(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MyFree(UNCServerName);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -733,7 +726,7 @@ SetupDiGetActualSectionToInstallExW(
|
||||||
OSVERSIONINFOEX VersionInfo;
|
OSVERSIONINFOEX VersionInfo;
|
||||||
SYSTEM_INFO SystemInfo;
|
SYSTEM_INFO SystemInfo;
|
||||||
VersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
VersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
||||||
ret = GetVersionEx((POSVERSIONINFO)&VersionInfo);
|
ret = GetVersionExW((OSVERSIONINFO*)&VersionInfo);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
goto done;
|
goto done;
|
||||||
GetSystemInfo(&SystemInfo);
|
GetSystemInfo(&SystemInfo);
|
||||||
|
@ -1540,7 +1533,7 @@ SetupDiCallClassInstaller(
|
||||||
}
|
}
|
||||||
if (CanHandle & CLASS_COINSTALLER)
|
if (CanHandle & CLASS_COINSTALLER)
|
||||||
{
|
{
|
||||||
rc = RegOpenKeyEx(
|
rc = RegOpenKeyExW(
|
||||||
HKEY_LOCAL_MACHINE,
|
HKEY_LOCAL_MACHINE,
|
||||||
REGSTR_PATH_CODEVICEINSTALLERS,
|
REGSTR_PATH_CODEVICEINSTALLERS,
|
||||||
0, /* Options */
|
0, /* Options */
|
||||||
|
@ -2139,7 +2132,7 @@ OpenHardwareProfileKey(
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WCHAR subKey[5];
|
WCHAR subKey[5];
|
||||||
snprintfW(subKey, 4, L"%04lu", HwProfile);
|
snprintfW(subKey, 4, InstanceKeyFormat, HwProfile);
|
||||||
subKey[4] = '\0';
|
subKey[4] = '\0';
|
||||||
rc = RegOpenKeyExW(
|
rc = RegOpenKeyExW(
|
||||||
hHWProfilesKey,
|
hHWProfilesKey,
|
||||||
|
@ -2266,7 +2259,7 @@ SetupDiCreateDevRegKeyW(
|
||||||
if (UuidToStringW((UUID*)&DeviceInfoData->ClassGuid, &lpGuidString) != RPC_S_OK)
|
if (UuidToStringW((UUID*)&DeviceInfoData->ClassGuid, &lpGuidString) != RPC_S_OK)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
/* The driver key is in \System\CurrentControlSet\Control\Class\{GUID}\Index */
|
/* The driver key is in \System\CurrentControlSet\Control\Class\{GUID}\Index */
|
||||||
DriverKey = HeapAlloc(GetProcessHeap(), 0, (strlenW(lpGuidString) + 7) * sizeof(WCHAR) + sizeof(UNICODE_STRING));
|
DriverKey = HeapAlloc(GetProcessHeap(), 0, (strlenW(lpGuidString) + 7) * sizeof(WCHAR) + sizeof(UNICODE_NULL));
|
||||||
if (!DriverKey)
|
if (!DriverKey)
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
|
@ -2274,8 +2267,9 @@ SetupDiCreateDevRegKeyW(
|
||||||
}
|
}
|
||||||
DriverKey[0] = '{';
|
DriverKey[0] = '{';
|
||||||
strcpyW(&DriverKey[1], lpGuidString);
|
strcpyW(&DriverKey[1], lpGuidString);
|
||||||
strcatW(DriverKey, L"}\\");
|
|
||||||
pDeviceInstance = &DriverKey[strlenW(DriverKey)];
|
pDeviceInstance = &DriverKey[strlenW(DriverKey)];
|
||||||
|
*pDeviceInstance++ = '}';
|
||||||
|
*pDeviceInstance++ = '\\';
|
||||||
rc = RegOpenKeyExW(RootKey,
|
rc = RegOpenKeyExW(RootKey,
|
||||||
REGSTR_PATH_CLASS_NT,
|
REGSTR_PATH_CLASS_NT,
|
||||||
0,
|
0,
|
||||||
|
@ -2292,8 +2286,8 @@ SetupDiCreateDevRegKeyW(
|
||||||
while (Index <= 9999)
|
while (Index <= 9999)
|
||||||
{
|
{
|
||||||
DWORD Disposition;
|
DWORD Disposition;
|
||||||
wsprintf(pDeviceInstance, L"%04lu", Index);
|
sprintfW(pDeviceInstance, InstanceKeyFormat, Index);
|
||||||
rc = RegCreateKeyEx(hClassKey,
|
rc = RegCreateKeyExW(hClassKey,
|
||||||
DriverKey,
|
DriverKey,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -2328,7 +2322,7 @@ SetupDiCreateDevRegKeyW(
|
||||||
hDeviceKey = SetupDiOpenDevRegKey(DeviceInfoSet, DeviceInfoData, Scope, HwProfile, DIREG_DEV, KEY_SET_VALUE);
|
hDeviceKey = SetupDiOpenDevRegKey(DeviceInfoSet, DeviceInfoData, Scope, HwProfile, DIREG_DEV, KEY_SET_VALUE);
|
||||||
if (hDeviceKey == INVALID_HANDLE_VALUE)
|
if (hDeviceKey == INVALID_HANDLE_VALUE)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
rc = RegSetValueEx(hDeviceKey, REGSTR_VAL_DRIVER, 0, REG_SZ, (const BYTE *)DriverKey, (strlenW(DriverKey) + 1) * sizeof(WCHAR));
|
rc = RegSetValueExW(hDeviceKey, REGSTR_VAL_DRIVER, 0, REG_SZ, (const BYTE *)DriverKey, (strlenW(DriverKey) + 1) * sizeof(WCHAR));
|
||||||
if (rc != ERROR_SUCCESS)
|
if (rc != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
SetLastError(rc);
|
SetLastError(rc);
|
||||||
|
@ -2883,7 +2877,7 @@ SetupDiSetSelectedDevice(
|
||||||
|
|
||||||
/* Return the current hardware profile id, or -1 if error */
|
/* Return the current hardware profile id, or -1 if error */
|
||||||
static DWORD
|
static DWORD
|
||||||
GetCurrentHwProfile(
|
SETUPAPI_GetCurrentHwProfile(
|
||||||
IN HDEVINFO DeviceInfoSet)
|
IN HDEVINFO DeviceInfoSet)
|
||||||
{
|
{
|
||||||
HKEY hKey = NULL;
|
HKEY hKey = NULL;
|
||||||
|
@ -3032,7 +3026,7 @@ SetupDiChangeState(
|
||||||
dwConfigFlags &= ~(PropChange->Scope == DICS_FLAG_GLOBAL ? CONFIGFLAG_DISABLED : CSCONFIGFLAG_DISABLED);
|
dwConfigFlags &= ~(PropChange->Scope == DICS_FLAG_GLOBAL ? CONFIGFLAG_DISABLED : CSCONFIGFLAG_DISABLED);
|
||||||
else
|
else
|
||||||
dwConfigFlags |= (PropChange->Scope == DICS_FLAG_GLOBAL ? CONFIGFLAG_DISABLED : CSCONFIGFLAG_DISABLED);
|
dwConfigFlags |= (PropChange->Scope == DICS_FLAG_GLOBAL ? CONFIGFLAG_DISABLED : CSCONFIGFLAG_DISABLED);
|
||||||
rc = RegSetValueEx(
|
rc = RegSetValueExW(
|
||||||
hKey,
|
hKey,
|
||||||
RegistryValueName,
|
RegistryValueName,
|
||||||
0,
|
0,
|
||||||
|
@ -3047,7 +3041,7 @@ SetupDiChangeState(
|
||||||
/* Enable/disable device if needed */
|
/* Enable/disable device if needed */
|
||||||
if (PropChange->Scope == DICS_FLAG_GLOBAL
|
if (PropChange->Scope == DICS_FLAG_GLOBAL
|
||||||
|| PropChange->HwProfile == 0
|
|| PropChange->HwProfile == 0
|
||||||
|| PropChange->HwProfile == GetCurrentHwProfile(DeviceInfoSet))
|
|| PropChange->HwProfile == SETUPAPI_GetCurrentHwProfile(DeviceInfoSet))
|
||||||
{
|
{
|
||||||
if (PropChange->StateChange == DICS_ENABLE)
|
if (PropChange->StateChange == DICS_ENABLE)
|
||||||
ret = ResetDevice(DeviceInfoSet, DeviceInfoData);
|
ret = ResetDevice(DeviceInfoSet, DeviceInfoData);
|
||||||
|
@ -3169,7 +3163,7 @@ SetupDiRegisterCoDeviceInstallers(
|
||||||
Result = SetupInstallFromInfSectionW(InstallParams.hwndParent,
|
Result = SetupInstallFromInfSectionW(InstallParams.hwndParent,
|
||||||
SelectedDriver->InfFileDetails->hInf, SectionName,
|
SelectedDriver->InfFileDetails->hInf, SectionName,
|
||||||
DoAction, hKey, SelectedDriver->InfFileDetails->DirectoryName, SP_COPY_NEWER,
|
DoAction, hKey, SelectedDriver->InfFileDetails->DirectoryName, SP_COPY_NEWER,
|
||||||
SetupDefaultQueueCallback, Context,
|
SetupDefaultQueueCallbackW, Context,
|
||||||
DeviceInfoSet, DeviceInfoData);
|
DeviceInfoSet, DeviceInfoData);
|
||||||
if (!Result)
|
if (!Result)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -3415,7 +3409,7 @@ SetupDiInstallDevice(
|
||||||
Result = SetupInstallFromInfSectionW(InstallParams.hwndParent,
|
Result = SetupInstallFromInfSectionW(InstallParams.hwndParent,
|
||||||
SelectedDriver->InfFileDetails->hInf, SectionName,
|
SelectedDriver->InfFileDetails->hInf, SectionName,
|
||||||
DoAction, hKey, SelectedDriver->InfFileDetails->DirectoryName, SP_COPY_NEWER,
|
DoAction, hKey, SelectedDriver->InfFileDetails->DirectoryName, SP_COPY_NEWER,
|
||||||
SetupDefaultQueueCallback, Context,
|
SetupDefaultQueueCallbackW, Context,
|
||||||
DeviceInfoSet, DeviceInfoData);
|
DeviceInfoSet, DeviceInfoData);
|
||||||
if (!Result)
|
if (!Result)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -3434,27 +3428,27 @@ SetupDiInstallDevice(
|
||||||
TRACE("InfSectionExt : '%s'\n", debugstr_w(&SectionName[strlenW(SelectedDriver->Details.SectionName)]));
|
TRACE("InfSectionExt : '%s'\n", debugstr_w(&SectionName[strlenW(SelectedDriver->Details.SectionName)]));
|
||||||
TRACE("MatchingDeviceId: '%s'\n", debugstr_w(SelectedDriver->MatchingId));
|
TRACE("MatchingDeviceId: '%s'\n", debugstr_w(SelectedDriver->MatchingId));
|
||||||
TRACE("ProviderName : '%s'\n", debugstr_w(SelectedDriver->Info.ProviderName));
|
TRACE("ProviderName : '%s'\n", debugstr_w(SelectedDriver->Info.ProviderName));
|
||||||
sprintfW(Buffer, L"%u-%u-%u", DriverDate.wMonth, DriverDate.wDay, DriverDate.wYear);
|
sprintfW(Buffer, DateFormat, DriverDate.wMonth, DriverDate.wDay, DriverDate.wYear);
|
||||||
rc = RegSetValueEx(hKey, REGSTR_DRIVER_DATE, 0, REG_SZ, (const BYTE *)Buffer, (strlenW(Buffer) + 1) * sizeof(WCHAR));
|
rc = RegSetValueExW(hKey, REGSTR_DRIVER_DATE, 0, REG_SZ, (const BYTE *)Buffer, (strlenW(Buffer) + 1) * sizeof(WCHAR));
|
||||||
if (rc == ERROR_SUCCESS)
|
if (rc == ERROR_SUCCESS)
|
||||||
rc = RegSetValueEx(hKey, REGSTR_DRIVER_DATE_DATA, 0, REG_BINARY, (const BYTE *)&SelectedDriver->Info.DriverDate, sizeof(FILETIME));
|
rc = RegSetValueExW(hKey, REGSTR_DRIVER_DATE_DATA, 0, REG_BINARY, (const BYTE *)&SelectedDriver->Info.DriverDate, sizeof(FILETIME));
|
||||||
if (rc == ERROR_SUCCESS)
|
if (rc == ERROR_SUCCESS)
|
||||||
rc = RegSetValueEx(hKey, REGSTR_VAL_DRVDESC, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.Description, (strlenW(SelectedDriver->Info.Description) + 1) * sizeof(WCHAR));
|
rc = RegSetValueExW(hKey, REGSTR_VAL_DRVDESC, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.Description, (strlenW(SelectedDriver->Info.Description) + 1) * sizeof(WCHAR));
|
||||||
if (rc == ERROR_SUCCESS)
|
if (rc == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
sprintfW(Buffer, L"%u.%u.%u.%u", fullVersion.HighPart >> 16, fullVersion.HighPart & 0xffff, fullVersion.LowPart >> 16, fullVersion.LowPart & 0xffff);
|
sprintfW(Buffer, VersionFormat, fullVersion.HighPart >> 16, fullVersion.HighPart & 0xffff, fullVersion.LowPart >> 16, fullVersion.LowPart & 0xffff);
|
||||||
rc = RegSetValueEx(hKey, REGSTR_DRIVER_VERSION, 0, REG_SZ, (const BYTE *)Buffer, (strlenW(Buffer) + 1) * sizeof(WCHAR));
|
rc = RegSetValueExW(hKey, REGSTR_DRIVER_VERSION, 0, REG_SZ, (const BYTE *)Buffer, (strlenW(Buffer) + 1) * sizeof(WCHAR));
|
||||||
}
|
}
|
||||||
if (rc == ERROR_SUCCESS)
|
if (rc == ERROR_SUCCESS)
|
||||||
rc = RegSetValueEx(hKey, REGSTR_VAL_INFPATH, 0, REG_SZ, (const BYTE *)SelectedDriver->InfFileDetails->FileName, (strlenW(SelectedDriver->InfFileDetails->FileName) + 1) * sizeof(WCHAR));
|
rc = RegSetValueExW(hKey, REGSTR_VAL_INFPATH, 0, REG_SZ, (const BYTE *)SelectedDriver->InfFileDetails->FileName, (strlenW(SelectedDriver->InfFileDetails->FileName) + 1) * sizeof(WCHAR));
|
||||||
if (rc == ERROR_SUCCESS)
|
if (rc == ERROR_SUCCESS)
|
||||||
rc = RegSetValueEx(hKey, REGSTR_VAL_INFSECTION, 0, REG_SZ, (const BYTE *)SelectedDriver->Details.SectionName, (strlenW(SelectedDriver->Details.SectionName) + 1) * sizeof(WCHAR));
|
rc = RegSetValueExW(hKey, REGSTR_VAL_INFSECTION, 0, REG_SZ, (const BYTE *)SelectedDriver->Details.SectionName, (strlenW(SelectedDriver->Details.SectionName) + 1) * sizeof(WCHAR));
|
||||||
if (rc == ERROR_SUCCESS)
|
if (rc == ERROR_SUCCESS)
|
||||||
rc = RegSetValueEx(hKey, REGSTR_VAL_INFSECTIONEXT, 0, REG_SZ, (const BYTE *)&SectionName[strlenW(SelectedDriver->Details.SectionName)], (strlenW(SectionName) - strlenW(SelectedDriver->Details.SectionName) + 1) * sizeof(WCHAR));
|
rc = RegSetValueExW(hKey, REGSTR_VAL_INFSECTIONEXT, 0, REG_SZ, (const BYTE *)&SectionName[strlenW(SelectedDriver->Details.SectionName)], (strlenW(SectionName) - strlenW(SelectedDriver->Details.SectionName) + 1) * sizeof(WCHAR));
|
||||||
if (rc == ERROR_SUCCESS)
|
if (rc == ERROR_SUCCESS)
|
||||||
rc = RegSetValueEx(hKey, REGSTR_VAL_MATCHINGDEVID, 0, REG_SZ, (const BYTE *)SelectedDriver->MatchingId, (strlenW(SelectedDriver->MatchingId) + 1) * sizeof(WCHAR));
|
rc = RegSetValueExW(hKey, REGSTR_VAL_MATCHINGDEVID, 0, REG_SZ, (const BYTE *)SelectedDriver->MatchingId, (strlenW(SelectedDriver->MatchingId) + 1) * sizeof(WCHAR));
|
||||||
if (rc == ERROR_SUCCESS)
|
if (rc == ERROR_SUCCESS)
|
||||||
rc = RegSetValueEx(hKey, REGSTR_VAL_PROVIDER_NAME, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.ProviderName, (strlenW(SelectedDriver->Info.ProviderName) + 1) * sizeof(WCHAR));
|
rc = RegSetValueExW(hKey, REGSTR_VAL_PROVIDER_NAME, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.ProviderName, (strlenW(SelectedDriver->Info.ProviderName) + 1) * sizeof(WCHAR));
|
||||||
if (rc != ERROR_SUCCESS)
|
if (rc != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
SetLastError(rc);
|
SetLastError(rc);
|
||||||
|
@ -3504,13 +3498,13 @@ SetupDiInstallDevice(
|
||||||
TRACE("ClassGUID : '%s'\n", debugstr_w(lpFullGuidString));
|
TRACE("ClassGUID : '%s'\n", debugstr_w(lpFullGuidString));
|
||||||
TRACE("DeviceDesc : '%s'\n", debugstr_w(SelectedDriver->Info.Description));
|
TRACE("DeviceDesc : '%s'\n", debugstr_w(SelectedDriver->Info.Description));
|
||||||
TRACE("Mfg : '%s'\n", debugstr_w(SelectedDriver->Info.MfgName));
|
TRACE("Mfg : '%s'\n", debugstr_w(SelectedDriver->Info.MfgName));
|
||||||
rc = RegSetValueEx(hKey, REGSTR_VAL_CLASS, 0, REG_SZ, (const BYTE *)ClassName, (strlenW(ClassName) + 1) * sizeof(WCHAR));
|
rc = RegSetValueExW(hKey, REGSTR_VAL_CLASS, 0, REG_SZ, (const BYTE *)ClassName, (strlenW(ClassName) + 1) * sizeof(WCHAR));
|
||||||
if (rc == ERROR_SUCCESS)
|
if (rc == ERROR_SUCCESS)
|
||||||
rc = RegSetValueEx(hKey, REGSTR_VAL_CLASSGUID, 0, REG_SZ, (const BYTE *)lpFullGuidString, (strlenW(lpFullGuidString) + 1) * sizeof(WCHAR));
|
rc = RegSetValueExW(hKey, REGSTR_VAL_CLASSGUID, 0, REG_SZ, (const BYTE *)lpFullGuidString, (strlenW(lpFullGuidString) + 1) * sizeof(WCHAR));
|
||||||
if (rc == ERROR_SUCCESS)
|
if (rc == ERROR_SUCCESS)
|
||||||
rc = RegSetValueEx(hKey, REGSTR_VAL_DEVDESC, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.Description, (strlenW(SelectedDriver->Info.Description) + 1) * sizeof(WCHAR));
|
rc = RegSetValueExW(hKey, REGSTR_VAL_DEVDESC, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.Description, (strlenW(SelectedDriver->Info.Description) + 1) * sizeof(WCHAR));
|
||||||
if (rc == ERROR_SUCCESS)
|
if (rc == ERROR_SUCCESS)
|
||||||
rc = RegSetValueEx(hKey, REGSTR_VAL_MFG, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.MfgName, (strlenW(SelectedDriver->Info.MfgName) + 1) * sizeof(WCHAR));
|
rc = RegSetValueExW(hKey, REGSTR_VAL_MFG, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.MfgName, (strlenW(SelectedDriver->Info.MfgName) + 1) * sizeof(WCHAR));
|
||||||
if (rc != ERROR_SUCCESS)
|
if (rc != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
SetLastError(rc);
|
SetLastError(rc);
|
||||||
|
|
|
@ -138,15 +138,15 @@ AddKnownDriverToList(
|
||||||
driverInfo->Params.cbSize = sizeof(SP_DRVINSTALL_PARAMS);
|
driverInfo->Params.cbSize = sizeof(SP_DRVINSTALL_PARAMS);
|
||||||
driverInfo->Params.Reserved = (ULONG_PTR)driverInfo;
|
driverInfo->Params.Reserved = (ULONG_PTR)driverInfo;
|
||||||
|
|
||||||
driverInfo->Details.cbSize = sizeof(SP_DRVINFO_DETAIL_DATA);
|
driverInfo->Details.cbSize = sizeof(SP_DRVINFO_DETAIL_DATA_W);
|
||||||
driverInfo->Details.Reserved = (ULONG_PTR)driverInfo;
|
driverInfo->Details.Reserved = (ULONG_PTR)driverInfo;
|
||||||
|
|
||||||
/* Copy InfFileName field */
|
/* Copy InfFileName field */
|
||||||
strncpyW(driverInfo->Details.InfFileName, InfFile, MAX_PATH - 1);
|
lstrcpynW(driverInfo->Details.InfFileName, InfFile, MAX_PATH - 1);
|
||||||
driverInfo->Details.InfFileName[MAX_PATH - 1] = '\0';
|
driverInfo->Details.InfFileName[MAX_PATH - 1] = '\0';
|
||||||
|
|
||||||
/* Fill InfDate field */
|
/* Fill InfDate field */
|
||||||
hFile = CreateFile(
|
hFile = CreateFileW(
|
||||||
InfFile,
|
InfFile,
|
||||||
GENERIC_READ, FILE_SHARE_READ,
|
GENERIC_READ, FILE_SHARE_READ,
|
||||||
NULL, OPEN_EXISTING, 0, NULL);
|
NULL, OPEN_EXISTING, 0, NULL);
|
||||||
|
@ -157,13 +157,13 @@ AddKnownDriverToList(
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
/* Fill SectionName field */
|
/* Fill SectionName field */
|
||||||
strncpyW(driverInfo->Details.SectionName, SectionName, LINE_LEN);
|
lstrcpynW(driverInfo->Details.SectionName, SectionName, LINE_LEN);
|
||||||
pDot = strchrW(driverInfo->Details.SectionName, '.');
|
pDot = strchrW(driverInfo->Details.SectionName, '.');
|
||||||
if (pDot)
|
if (pDot)
|
||||||
*pDot = UNICODE_NULL;
|
*pDot = UNICODE_NULL;
|
||||||
|
|
||||||
/* Fill DrvDescription field */
|
/* Fill DrvDescription field */
|
||||||
strncpyW(driverInfo->Details.DrvDescription, DriverDescription, LINE_LEN);
|
lstrcpynW(driverInfo->Details.DrvDescription, DriverDescription, LINE_LEN);
|
||||||
|
|
||||||
/* Copy MatchingId information */
|
/* Copy MatchingId information */
|
||||||
if (MatchingId)
|
if (MatchingId)
|
||||||
|
@ -188,13 +188,13 @@ AddKnownDriverToList(
|
||||||
memcpy(&driverInfo->ClassGuid, ClassGuid, sizeof(GUID));
|
memcpy(&driverInfo->ClassGuid, ClassGuid, sizeof(GUID));
|
||||||
driverInfo->Info.DriverType = DriverType;
|
driverInfo->Info.DriverType = DriverType;
|
||||||
driverInfo->Info.Reserved = (ULONG_PTR)driverInfo;
|
driverInfo->Info.Reserved = (ULONG_PTR)driverInfo;
|
||||||
strncpyW(driverInfo->Info.Description, driverInfo->Details.DrvDescription, LINE_LEN - 1);
|
lstrcpynW(driverInfo->Info.Description, driverInfo->Details.DrvDescription, LINE_LEN - 1);
|
||||||
driverInfo->Info.Description[LINE_LEN - 1] = '\0';
|
driverInfo->Info.Description[LINE_LEN - 1] = '\0';
|
||||||
strncpyW(driverInfo->Info.MfgName, ManufacturerName, LINE_LEN - 1);
|
lstrcpynW(driverInfo->Info.MfgName, ManufacturerName, LINE_LEN - 1);
|
||||||
driverInfo->Info.MfgName[LINE_LEN - 1] = '\0';
|
driverInfo->Info.MfgName[LINE_LEN - 1] = '\0';
|
||||||
if (ProviderName)
|
if (ProviderName)
|
||||||
{
|
{
|
||||||
strncpyW(driverInfo->Info.ProviderName, ProviderName, LINE_LEN - 1);
|
lstrcpynW(driverInfo->Info.ProviderName, ProviderName, LINE_LEN - 1);
|
||||||
driverInfo->Info.ProviderName[LINE_LEN - 1] = '\0';
|
driverInfo->Info.ProviderName[LINE_LEN - 1] = '\0';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2152,7 +2152,7 @@ SetupDiInstallDriverFiles(
|
||||||
Context = SetupInitDefaultQueueCallback(InstallParams.hwndParent);
|
Context = SetupInitDefaultQueueCallback(InstallParams.hwndParent);
|
||||||
if (!Context)
|
if (!Context)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
InstallMsgHandler = SetupDefaultQueueCallback;
|
InstallMsgHandler = SetupDefaultQueueCallbackW;
|
||||||
InstallMsgHandlerContext = Context;
|
InstallMsgHandlerContext = Context;
|
||||||
}
|
}
|
||||||
ret = SetupInstallFromInfSectionW(InstallParams.hwndParent,
|
ret = SetupInstallFromInfSectionW(InstallParams.hwndParent,
|
||||||
|
|
|
@ -25,7 +25,20 @@ WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
|
||||||
|
|
||||||
/* Unicode constants */
|
/* Unicode constants */
|
||||||
static const WCHAR BackSlash[] = {'\\',0};
|
static const WCHAR BackSlash[] = {'\\',0};
|
||||||
|
static const WCHAR GroupOrderListKey[] = {'S','Y','S','T','E','M','\\','C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\','C','o','n','t','r','o','l','\\','G','r','o','u','p','O','r','d','e','r','L','i','s','t',0};
|
||||||
static const WCHAR InfDirectory[] = {'i','n','f','\\',0};
|
static const WCHAR InfDirectory[] = {'i','n','f','\\',0};
|
||||||
|
static const WCHAR OemFileMask[] = {'o','e','m','*','.','i','n','f',0};
|
||||||
|
static const WCHAR OemFileSpecification[] = {'o','e','m','%','l','u','.','i','n','f',0};
|
||||||
|
|
||||||
|
static const WCHAR DependenciesKey[] = {'D','e','p','e','n','d','e','n','c','i','e','s',0};
|
||||||
|
static const WCHAR DescriptionKey[] = {'D','e','s','c','r','i','p','t','i','o','n',0};
|
||||||
|
static const WCHAR DisplayNameKey[] = {'D','i','s','p','l','a','y','N','a','m','e',0};
|
||||||
|
static const WCHAR ErrorControlKey[] = {'E','r','r','o','r','C','o','n','t','r','o','l',0};
|
||||||
|
static const WCHAR LoadOrderGroupKey[] = {'L','o','a','d','O','r','d','e','r','G','r','o','u','p',0};
|
||||||
|
static const WCHAR SecurityKey[] = {'S','e','c','u','r','i','t','y',0};
|
||||||
|
static const WCHAR ServiceBinaryKey[] = {'S','e','r','v','i','c','e','B','i','n','a','r','y',0};
|
||||||
|
static const WCHAR ServiceTypeKey[] = {'S','e','r','v','i','c','e','T','y','p','e',0};
|
||||||
|
static const WCHAR StartTypeKey[] = {'S','t','a','r','t','T','y','p','e',0};
|
||||||
|
|
||||||
/* info passed to callback functions dealing with files */
|
/* info passed to callback functions dealing with files */
|
||||||
struct files_callback_info
|
struct files_callback_info
|
||||||
|
@ -90,6 +103,9 @@ static const WCHAR ProfileItems[] = {'P','r','o','f','i','l','e','I','t','e',
|
||||||
static const WCHAR Include[] = {'I','n','c','l','u','d','e',0};
|
static const WCHAR Include[] = {'I','n','c','l','u','d','e',0};
|
||||||
static const WCHAR Needs[] = {'N','e','e','d','s',0};
|
static const WCHAR Needs[] = {'N','e','e','d','s',0};
|
||||||
static const WCHAR DotSecurity[] = {'.','S','e','c','u','r','i','t','y',0};
|
static const WCHAR DotSecurity[] = {'.','S','e','c','u','r','i','t','y',0};
|
||||||
|
#ifdef __WINESRC__
|
||||||
|
static const WCHAR WineFakeDlls[] = {'W','i','n','e','F','a','k','e','D','l','l','s',0};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -411,7 +427,7 @@ static BOOL registry_callback( HINF hinf, PCWSTR field, void *arg )
|
||||||
MyFree(security_key);
|
MyFree(security_key);
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
if (!SetupGetLineText( &security_context, NULL, NULL, NULL, NULL, 0, &required ))
|
if (!SetupGetLineTextW( &security_context, NULL, NULL, NULL, NULL, 0, &required ))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
security_descriptor = MyMalloc( required * sizeof(WCHAR) );
|
security_descriptor = MyMalloc( required * sizeof(WCHAR) );
|
||||||
if (!security_descriptor)
|
if (!security_descriptor)
|
||||||
|
@ -419,7 +435,7 @@ static BOOL registry_callback( HINF hinf, PCWSTR field, void *arg )
|
||||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (!SetupGetLineText( &security_context, NULL, NULL, NULL, security_descriptor, required, NULL ))
|
if (!SetupGetLineTextW( &security_context, NULL, NULL, NULL, security_descriptor, required, NULL ))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
ok = ConvertStringSecurityDescriptorToSecurityDescriptorW( security_descriptor, SDDL_REVISION_1, &sd, NULL );
|
ok = ConvertStringSecurityDescriptorToSecurityDescriptorW( security_descriptor, SDDL_REVISION_1, &sd, NULL );
|
||||||
MyFree( security_descriptor );
|
MyFree( security_descriptor );
|
||||||
|
@ -1306,7 +1322,7 @@ static BOOL InstallOneService(
|
||||||
SC_HANDLE hSCManager = NULL;
|
SC_HANDLE hSCManager = NULL;
|
||||||
SC_HANDLE hService = NULL;
|
SC_HANDLE hService = NULL;
|
||||||
LPDWORD GroupOrder = NULL;
|
LPDWORD GroupOrder = NULL;
|
||||||
LPQUERY_SERVICE_CONFIG ServiceConfig = NULL;
|
LPQUERY_SERVICE_CONFIGW ServiceConfig = NULL;
|
||||||
BOOL ret = FALSE;
|
BOOL ret = FALSE;
|
||||||
|
|
||||||
HKEY hGroupOrderListKey = NULL;
|
HKEY hGroupOrderListKey = NULL;
|
||||||
|
@ -1322,11 +1338,11 @@ static BOOL InstallOneService(
|
||||||
DWORD tagId = (DWORD)-1;
|
DWORD tagId = (DWORD)-1;
|
||||||
BOOL useTag;
|
BOOL useTag;
|
||||||
|
|
||||||
if (!GetIntField(hInf, ServiceSection, L"ServiceType", &ServiceType))
|
if (!GetIntField(hInf, ServiceSection, ServiceTypeKey, &ServiceType))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
if (!GetIntField(hInf, ServiceSection, L"StartType", &StartType))
|
if (!GetIntField(hInf, ServiceSection, StartTypeKey, &StartType))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
if (!GetIntField(hInf, ServiceSection, L"ErrorControl", &ErrorControl))
|
if (!GetIntField(hInf, ServiceSection, ErrorControlKey, &ErrorControl))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
useTag = (ServiceType == SERVICE_BOOT_START || ServiceType == SERVICE_SYSTEM_START);
|
useTag = (ServiceType == SERVICE_BOOT_START || ServiceType == SERVICE_SYSTEM_START);
|
||||||
|
|
||||||
|
@ -1334,15 +1350,15 @@ static BOOL InstallOneService(
|
||||||
if (hSCManager == NULL)
|
if (hSCManager == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (!GetLineText(hInf, ServiceSection, L"ServiceBinary", &ServiceBinary))
|
if (!GetLineText(hInf, ServiceSection, ServiceBinaryKey, &ServiceBinary))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
/* Don't check return value, as these fields are optional and
|
/* Don't check return value, as these fields are optional and
|
||||||
* GetLineText initialize output parameter even on failure */
|
* GetLineText initialize output parameter even on failure */
|
||||||
GetLineText(hInf, ServiceSection, L"LoadOrderGroup", &LoadOrderGroup);
|
GetLineText(hInf, ServiceSection, LoadOrderGroupKey, &LoadOrderGroup);
|
||||||
GetLineText(hInf, ServiceSection, L"DisplayName", &DisplayName);
|
GetLineText(hInf, ServiceSection, DisplayNameKey, &DisplayName);
|
||||||
GetLineText(hInf, ServiceSection, L"Description", &Description);
|
GetLineText(hInf, ServiceSection, DescriptionKey, &Description);
|
||||||
GetLineText(hInf, ServiceSection, L"Dependencies", &Dependencies);
|
GetLineText(hInf, ServiceSection, DependenciesKey, &Dependencies);
|
||||||
|
|
||||||
hService = OpenServiceW(
|
hService = OpenServiceW(
|
||||||
hSCManager,
|
hSCManager,
|
||||||
|
@ -1413,7 +1429,7 @@ static BOOL InstallOneService(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set security */
|
/* Set security */
|
||||||
if (GetLineText(hInf, ServiceSection, L"Security", &SecurityDescriptor))
|
if (GetLineText(hInf, ServiceSection, SecurityKey, &SecurityDescriptor))
|
||||||
{
|
{
|
||||||
ret = ConvertStringSecurityDescriptorToSecurityDescriptorW(SecurityDescriptor, SDDL_REVISION_1, &sd, NULL);
|
ret = ConvertStringSecurityDescriptorToSecurityDescriptorW(SecurityDescriptor, SDDL_REVISION_1, &sd, NULL);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
|
@ -1436,9 +1452,9 @@ static BOOL InstallOneService(
|
||||||
if ((ServiceFlags & SPSVCINST_NOCLOBBER_LOADORDERGROUP) && ServiceConfig && ServiceConfig->lpLoadOrderGroup)
|
if ((ServiceFlags & SPSVCINST_NOCLOBBER_LOADORDERGROUP) && ServiceConfig && ServiceConfig->lpLoadOrderGroup)
|
||||||
lpLoadOrderGroup = ServiceConfig->lpLoadOrderGroup;
|
lpLoadOrderGroup = ServiceConfig->lpLoadOrderGroup;
|
||||||
|
|
||||||
rc = RegOpenKey(
|
rc = RegOpenKeyW(
|
||||||
list ? list->HKLM : HKEY_LOCAL_MACHINE,
|
list ? list->HKLM : HKEY_LOCAL_MACHINE,
|
||||||
L"SYSTEM\\CurrentControlSet\\Control\\GroupOrderList",
|
GroupOrderListKey,
|
||||||
&hGroupOrderListKey);
|
&hGroupOrderListKey);
|
||||||
if (rc != ERROR_SUCCESS)
|
if (rc != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
|
@ -1809,7 +1825,7 @@ BOOL WINAPI SetupCopyOEMInfW(
|
||||||
strcatW(pFullFileName, BackSlash);
|
strcatW(pFullFileName, BackSlash);
|
||||||
strcatW(pFullFileName, InfDirectory);
|
strcatW(pFullFileName, InfDirectory);
|
||||||
pFileName = &pFullFileName[strlenW(pFullFileName)];
|
pFileName = &pFullFileName[strlenW(pFullFileName)];
|
||||||
sprintfW(pFileName, L"oem*.inf", NextFreeNumber);
|
sprintfW(pFileName, OemFileMask, NextFreeNumber);
|
||||||
hSearch = FindFirstFileW(pFullFileName, &FindFileData);
|
hSearch = FindFirstFileW(pFullFileName, &FindFileData);
|
||||||
if (hSearch == INVALID_HANDLE_VALUE)
|
if (hSearch == INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
|
@ -1821,12 +1837,12 @@ BOOL WINAPI SetupCopyOEMInfW(
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
DWORD CurrentNumber;
|
DWORD CurrentNumber;
|
||||||
if (swscanf(FindFileData.cFileName, L"oem%lu.inf", &CurrentNumber) == 1
|
if (swscanf(FindFileData.cFileName, OemFileSpecification, &CurrentNumber) == 1
|
||||||
&& CurrentNumber <= 99999)
|
&& CurrentNumber <= 99999)
|
||||||
{
|
{
|
||||||
NextFreeNumber = CurrentNumber + 1;
|
NextFreeNumber = CurrentNumber + 1;
|
||||||
}
|
}
|
||||||
} while (FindNextFile(hSearch, &FindFileData));
|
} while (FindNextFileW(hSearch, &FindFileData));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NextFreeNumber > 99999)
|
if (NextFreeNumber > 99999)
|
||||||
|
@ -1837,7 +1853,7 @@ BOOL WINAPI SetupCopyOEMInfW(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create the full path: %WINDIR%\Inf\OEM{XXXXX}.inf */
|
/* Create the full path: %WINDIR%\Inf\OEM{XXXXX}.inf */
|
||||||
sprintfW(pFileName, L"oem%lu.inf", NextFreeNumber);
|
sprintfW(pFileName, OemFileSpecification, NextFreeNumber);
|
||||||
TRACE("Next available file is %s\n", debugstr_w(pFileName));
|
TRACE("Next available file is %s\n", debugstr_w(pFileName));
|
||||||
|
|
||||||
if (RequiredSize)
|
if (RequiredSize)
|
||||||
|
|
|
@ -22,6 +22,10 @@
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
|
WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
|
||||||
|
|
||||||
|
/* Unicode constants */
|
||||||
|
static const WCHAR BackSlash[] = {'\\',0};
|
||||||
|
static const WCHAR TranslationRegKey[] = {'\\','V','e','r','F','i','l','e','I','n','f','o','\\','T','r','a','n','s','l','a','t','i','o','n',0};
|
||||||
|
|
||||||
DWORD
|
DWORD
|
||||||
GetFunctionPointer(
|
GetFunctionPointer(
|
||||||
IN PWSTR InstallerName,
|
IN PWSTR InstallerName,
|
||||||
|
@ -1190,7 +1194,7 @@ GetVersionInfoFromImage(LPWSTR lpFileName,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!VerQueryValueW(lpInfo, L"\\",
|
if (!VerQueryValueW(lpInfo, BackSlash,
|
||||||
(LPVOID*)&lpFixedInfo, &uSize))
|
(LPVOID*)&lpFixedInfo, &uSize))
|
||||||
{
|
{
|
||||||
MyFree(lpInfo);
|
MyFree(lpInfo);
|
||||||
|
@ -1201,7 +1205,7 @@ GetVersionInfoFromImage(LPWSTR lpFileName,
|
||||||
lpFileVersion->HighPart = lpFixedInfo->dwFileVersionMS;
|
lpFileVersion->HighPart = lpFixedInfo->dwFileVersionMS;
|
||||||
|
|
||||||
*lpVersionVarSize = 0;
|
*lpVersionVarSize = 0;
|
||||||
if (!VerQueryValueW(lpInfo, L"\\VerFileInfo\\Translation",
|
if (!VerQueryValueW(lpInfo, TranslationRegKey,
|
||||||
(LPVOID*)&lpVarSize, &uSize))
|
(LPVOID*)&lpVarSize, &uSize))
|
||||||
{
|
{
|
||||||
MyFree(lpInfo);
|
MyFree(lpInfo);
|
||||||
|
|
|
@ -25,6 +25,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
|
||||||
|
|
||||||
/* Unicode constants */
|
/* Unicode constants */
|
||||||
static const WCHAR BackSlash[] = {'\\',0};
|
static const WCHAR BackSlash[] = {'\\',0};
|
||||||
|
static const WCHAR Class[] = {'C','l','a','s','s',0};
|
||||||
|
static const WCHAR ClassGUID[] = {'C','l','a','s','s','G','U','I','D',0};
|
||||||
static const WCHAR InfDirectory[] = {'i','n','f','\\',0};
|
static const WCHAR InfDirectory[] = {'i','n','f','\\',0};
|
||||||
static const WCHAR InfFileSpecification[] = {'*','.','i','n','f',0};
|
static const WCHAR InfFileSpecification[] = {'*','.','i','n','f',0};
|
||||||
|
|
||||||
|
@ -1073,7 +1075,7 @@ HINF WINAPI SetupOpenInfFileA( PCSTR name, PCSTR class, DWORD style, UINT *error
|
||||||
|
|
||||||
|
|
||||||
static BOOL
|
static BOOL
|
||||||
GetInfClassW(
|
PARSER_GetInfClassW(
|
||||||
IN HINF hInf,
|
IN HINF hInf,
|
||||||
OUT LPGUID ClassGuid,
|
OUT LPGUID ClassGuid,
|
||||||
OUT PWSTR ClassName,
|
OUT PWSTR ClassName,
|
||||||
|
@ -1085,14 +1087,14 @@ GetInfClassW(
|
||||||
BOOL ret = FALSE;
|
BOOL ret = FALSE;
|
||||||
|
|
||||||
/* Read class Guid */
|
/* Read class Guid */
|
||||||
if (!SetupGetLineTextW(NULL, hInf, L"Version", L"ClassGUID", guidW, sizeof(guidW), NULL))
|
if (!SetupGetLineTextW(NULL, hInf, Version, ClassGUID, guidW, sizeof(guidW), NULL))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
guidW[37] = '\0'; /* Replace the } by a NULL character */
|
guidW[37] = '\0'; /* Replace the } by a NULL character */
|
||||||
if (UuidFromStringW(&guidW[1], ClassGuid) != RPC_S_OK)
|
if (UuidFromStringW(&guidW[1], ClassGuid) != RPC_S_OK)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
/* Read class name */
|
/* Read class name */
|
||||||
ret = SetupGetLineTextW(NULL, hInf, L"Version", L"Class", ClassName, ClassNameSize, &requiredSize);
|
ret = SetupGetLineTextW(NULL, hInf, Version, Class, ClassName, ClassNameSize, &requiredSize);
|
||||||
if (ret && ClassName == NULL && ClassNameSize == 0)
|
if (ret && ClassName == NULL && ClassNameSize == 0)
|
||||||
{
|
{
|
||||||
if (RequiredSize)
|
if (RequiredSize)
|
||||||
|
@ -1215,7 +1217,7 @@ HINF WINAPI SetupOpenInfFileW( PCWSTR name, PCWSTR class, DWORD style, UINT *err
|
||||||
SetupCloseInfFile((HINF)file);
|
SetupCloseInfFile((HINF)file);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else if (!GetInfClassW((HINF)file, &ClassGuid, ClassName, strlenW(class) + 1, NULL))
|
else if (!PARSER_GetInfClassW((HINF)file, &ClassGuid, ClassName, strlenW(class) + 1, NULL))
|
||||||
{
|
{
|
||||||
/* Unable to get class name in .inf file */
|
/* Unable to get class name in .inf file */
|
||||||
HeapFree(GetProcessHeap(), 0, ClassName);
|
HeapFree(GetProcessHeap(), 0, ClassName);
|
||||||
|
@ -2197,7 +2199,7 @@ SetupDiGetINFClassW(
|
||||||
if (hInf == INVALID_HANDLE_VALUE)
|
if (hInf == INVALID_HANDLE_VALUE)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = GetInfClassW(hInf, ClassGuid, ClassName, ClassNameSize, RequiredSize);
|
ret = PARSER_GetInfClassW(hInf, ClassGuid, ClassName, ClassNameSize, RequiredSize);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (hInf != INVALID_HANDLE_VALUE)
|
if (hInf != INVALID_HANDLE_VALUE)
|
||||||
|
|
|
@ -763,7 +763,7 @@ BOOL WINAPI SetupQueueCopySectionW( HSPFILEQ queue, PCWSTR src_root, HINF hinf,
|
||||||
MyFree(security_key);
|
MyFree(security_key);
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
if (!SetupGetLineText( &security_context, NULL, NULL, NULL, NULL, 0, &required ))
|
if (!SetupGetLineTextW( &security_context, NULL, NULL, NULL, NULL, 0, &required ))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
security_descriptor = MyMalloc( required * sizeof(WCHAR) );
|
security_descriptor = MyMalloc( required * sizeof(WCHAR) );
|
||||||
if (!security_descriptor)
|
if (!security_descriptor)
|
||||||
|
@ -771,7 +771,7 @@ BOOL WINAPI SetupQueueCopySectionW( HSPFILEQ queue, PCWSTR src_root, HINF hinf,
|
||||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (!SetupGetLineText( &security_context, NULL, NULL, NULL, security_descriptor, required, NULL ))
|
if (!SetupGetLineTextW( &security_context, NULL, NULL, NULL, security_descriptor, required, NULL ))
|
||||||
{
|
{
|
||||||
MyFree( security_descriptor );
|
MyFree( security_descriptor );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
Loading…
Reference in a new issue