* Open a shell folder using "explorer.exe". The passed CLSIDs
* are all subfolders of the "Control Panel" shell folder.
*/
- StringCbCopy(szParameters, sizeof(szParameters), L"/n,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}");
- StringCbCat(szParameters,sizeof(szParameters), lpFolderCLSID);
+ StringCbCopyW(szParameters, sizeof(szParameters), L"/n,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}");
+ StringCbCatW(szParameters, sizeof(szParameters), lpFolderCLSID);
return (INT_PTR)ShellExecuteW(NULL,
L"open",
CONSOLE_SCREEN_BUFFER_INFO csbi;
va_start(args, lpFmt);
- StringCbVPrintf(szTxt, sizeof(szTxt), lpFmt, args);
+ StringCbVPrintfW(szTxt, sizeof(szTxt), lpFmt, args);
va_end(args);
if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi))
(wcslen(pszRet) + 1) * sizeof(WCHAR));
if (pszBuf != NULL)
{
- hr = StringCbCopy(pszBuf, (wcslen(pszRet) + 1) * sizeof(WCHAR), pszRet);
+ hr = StringCbCopyW(pszBuf, (wcslen(pszRet) + 1) * sizeof(WCHAR), pszRet);
if (FAILED(hr))
{
GlobalFree(pszBuf);
// construct default 'FileExtensionFile' by formatting the uppercase extension
// with IDS_FILE_EXT_TYPE, outputting something like a l18n 'INI File'
- StringCbPrintf(Entry->FileDescription, sizeof(Entry->FileDescription), szFile, &Entry->FileExtension[1]);
+ StringCbPrintfW(Entry->FileDescription, sizeof(Entry->FileDescription),
+ szFile, &Entry->FileExtension[1]);
}
ZeroMemory(&lvItem, sizeof(LVITEMW));
// Copy and retrieve the root path from get given string
WCHAR wszRootPathName[MAX_PATH];
- StringCbCopy(wszRootPathName, sizeof(wszRootPathName), wszPath);
+ StringCbCopyW(wszRootPathName, sizeof(wszRootPathName), wszPath);
PathStripToRootW(wszRootPathName);
// Test to see if the drive is fixed (non removable)
{
WCHAR ServicePath[MAX_PATH];
- StringCbCopy(ServicePath, sizeof ServicePath, ServiceName);
- StringCbCat(ServicePath, sizeof ServicePath, L"_drv.sys");
+ StringCbCopyW(ServicePath, sizeof(ServicePath), ServiceName);
+ StringCbCatW(ServicePath, sizeof(ServicePath), L"_drv.sys");
- StringCbCopy(TestServiceName, sizeof TestServiceName, L"Kmtest-");
- StringCbCat(TestServiceName, sizeof TestServiceName, ServiceName);
+ StringCbCopyW(TestServiceName, sizeof(TestServiceName), L"Kmtest-");
+ StringCbCatW(TestServiceName, sizeof(TestServiceName), ServiceName);
return KmtpCreateService(TestServiceName,
ServicePath,
DWORD Zero = 0;
LONG Error;
- StringCbCopy(KeyPath, sizeof KeyPath, L"SYSTEM\\CurrentControlSet\\Services\\");
- StringCbCat(KeyPath, sizeof KeyPath, TestServiceName);
- StringCbCat(KeyPath, sizeof KeyPath, L"\\Instances\\");
+ StringCbCopyW(KeyPath, sizeof(KeyPath), L"SYSTEM\\CurrentControlSet\\Services\\");
+ StringCbCatW(KeyPath, sizeof(KeyPath), TestServiceName);
+ StringCbCatW(KeyPath, sizeof(KeyPath), L"\\Instances\\");
Error = RegCreateKeyEx(HKEY_LOCAL_MACHINE,
KeyPath,
return Error;
}
- StringCbCopy(DefaultInstance, sizeof DefaultInstance, TestServiceName);
- StringCbCat(DefaultInstance, sizeof DefaultInstance, L" Instance");
+ StringCbCopyW(DefaultInstance, sizeof(DefaultInstance), TestServiceName);
+ StringCbCatW(DefaultInstance, sizeof(DefaultInstance), L" Instance");
Error = RegSetValueExW(hKey,
L"DefaultInstance",
assert(wcsrchr(DriverPath, L'\\') != NULL);
wcsrchr(DriverPath, L'\\')[1] = L'\0';
- result = StringCbCat(DriverPath, sizeof DriverPath, ServicePath);
+ result = StringCbCatW(DriverPath, sizeof(DriverPath), ServicePath);
if (FAILED(result))
error_value_goto(Error, result, cleanup);
DWORD Error = ERROR_SUCCESS;
WCHAR ServicePath[MAX_PATH];
- StringCbCopy(ServicePath, sizeof ServicePath, ServiceName);
- StringCbCat(ServicePath, sizeof ServicePath, L"_drv.sys");
+ StringCbCopyW(ServicePath, sizeof(ServicePath), ServiceName);
+ StringCbCatW(ServicePath, sizeof(ServicePath), L"_drv.sys");
- StringCbCopy(TestServiceName, sizeof TestServiceName, L"Kmtest-");
- StringCbCat(TestServiceName, sizeof TestServiceName, ServiceName);
+ StringCbCopyW(TestServiceName, sizeof(TestServiceName), L"Kmtest-");
+ StringCbCatW(TestServiceName, sizeof(TestServiceName), ServiceName);
Error = KmtCreateAndStartService(TestServiceName, ServicePath, NULL, &TestServiceHandle, RestartIfRunning);
DWORD Error = ERROR_SUCCESS;
WCHAR DevicePath[MAX_PATH];
- StringCbCopy(DevicePath, sizeof DevicePath, L"\\\\.\\Global\\GLOBALROOT\\Device\\");
- StringCbCat(DevicePath, sizeof DevicePath, TestServiceName);
+ StringCbCopyW(DevicePath, sizeof(DevicePath), L"\\\\.\\Global\\GLOBALROOT\\Device\\");
+ StringCbCatW(DevicePath, sizeof(DevicePath), TestServiceName);
TestDeviceHandle = CreateFile(DevicePath, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
if (TestDeviceHandle == INVALID_HANDLE_VALUE)