(NTAPI *PPROCESS_ENTRY_ROUTINE)(
IN PWCHAR KeyName,
IN PWCHAR KeyValue,
- IN PCHAR DisplayText,
+ OUT PWCHAR DisplayText,
IN SIZE_T DisplayTextSize,
OUT PVOID* UserData,
OUT PBOOLEAN Current,
PVOID UserData;
BOOLEAN Current;
UCHAR RetVal;
- CHAR DisplayText[128];
+ WCHAR DisplayText[128];
if (!SetupFindFirstLineW(InfFile, SectionName, NULL, pContext))
return -1;
DefaultProcessEntry(
IN PWCHAR KeyName,
IN PWCHAR KeyValue,
- IN PCHAR DisplayText,
+ OUT PWCHAR DisplayText,
IN SIZE_T DisplayTextSize,
OUT PVOID* UserData,
OUT PBOOLEAN Current,
}
wcscpy((PWCHAR)*UserData, KeyName);
- sprintf(DisplayText, "%S", KeyValue);
+ RtlStringCbCopyW(DisplayText, DisplayTextSize, KeyValue);
*Current = (CompareKey ? !_wcsicmp(KeyName, CompareKey) : FALSE);
}
DPRINT("Computer key: %S\n", KeyName);
- wcscpy(ComputerKey, KeyName);
+ RtlStringCchCopyW(ComputerKey, ARRAYSIZE(ComputerKey), KeyName);
INF_FreeData(KeyName);
} while (SetupFindNextLine(&Context, &Context));
BusInstance = 0;
while (TRUE)
{
- swprintf(Buffer, L"%lu", BusInstance);
+ RtlStringCchPrintfW(Buffer, ARRAYSIZE(Buffer), L"%lu", BusInstance);
RtlInitUnicodeString(&KeyName, Buffer);
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
while (TRUE)
{
/* Open the pointer controller instance key */
- swprintf(Buffer, L"%lu", ControllerInstance);
+ RtlStringCchPrintfW(Buffer, ARRAYSIZE(Buffer), L"%lu", ControllerInstance);
RtlInitUnicodeString(&KeyName, Buffer);
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
}
DPRINT("Display key: %S\n", KeyName);
- wcscpy(DisplayKey, KeyName);
+ RtlStringCchCopyW(DisplayKey, ARRAYSIZE(DisplayKey), KeyName);
INF_FreeData(KeyName);
} while (SetupFindNextLine(&Context, &Context));
}
#if 0
- AppendGenericListEntry(List, "Other display driver", NULL, TRUE);
+ AppendGenericListEntry(List, L"Other display driver", NULL, TRUE);
#endif
return List;
return FALSE;
}
- wcscpy(SectionName, L"Files.");
- wcscat(SectionName, (const wchar_t*)GetListEntryUserData(Entry));
+ RtlStringCchPrintfW(SectionName, ARRAYSIZE(SectionName),
+ L"Files.%s", (PCWSTR)GetListEntryUserData(Entry));
*AdditionalSectionName = SectionName;
return TRUE;
ASSERT(wcslen(ServiceName) < 10);
DPRINT1("Service name: '%S'\n", ServiceName);
- swprintf(RegPath, L"System\\CurrentControlSet\\Services\\%s", ServiceName);
+ RtlStringCchPrintfW(RegPath, ARRAYSIZE(RegPath),
+ L"System\\CurrentControlSet\\Services\\%s",
+ ServiceName);
RtlInitUnicodeString(&KeyName, RegPath);
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
return FALSE;
}
- swprintf(RegPath,
- L"System\\CurrentControlSet\\Hardware Profiles\\Current\\System\\CurrentControlSet\\Services\\%s\\Device0",
- ServiceName);
+ RtlStringCchPrintfW(RegPath, ARRAYSIZE(RegPath),
+ L"System\\CurrentControlSet\\Hardware Profiles\\Current\\System\\CurrentControlSet\\Services\\%s\\Device0",
+ ServiceName);
DPRINT1("RegPath: '%S'\n", RegPath);
RtlInitUnicodeString(&KeyName, RegPath);
InitializeObjectAttributes(&ObjectAttributes,
ProcessLangEntry(
IN PWCHAR KeyName,
IN PWCHAR KeyValue,
- IN PCHAR DisplayText,
+ OUT PWCHAR DisplayText,
IN SIZE_T DisplayTextSize,
OUT PVOID* UserData,
OUT PBOOLEAN Current,
}
wcscpy((PWCHAR)*UserData, KeyName);
- sprintf(DisplayText, "%S", KeyValue);
+ RtlStringCbCopyW(DisplayText, DisplayTextSize, KeyValue);
*Current = FALSE;