static BOOL get_item_path(HWND hwndTV, HTREEITEM hItem, HKEY* phKey, LPWSTR* pKeyPath, int* pPathLen, int* pMaxLen)
{
- TVITEM item;
+ TVITEMW item;
size_t maxLen, len;
LPWSTR newStr;
/* Add an entry to the tree. Only give hKey for root nodes (HKEY_ constants) */
static HTREEITEM AddEntryToTree(HWND hwndTV, HTREEITEM hParent, LPWSTR label, HKEY hKey, DWORD dwChildren)
{
- TVITEM tvi;
- TVINSERTSTRUCT tvins;
+ TVITEMW tvi;
+ TVINSERTSTRUCTW tvins;
if (hKey)
{
LPCWSTR KeyPath;
DWORD dwCount, dwIndex, dwMaxSubKeyLen;
LPWSTR Name = NULL;
- TVITEM tvItem;
+ TVITEMW tvItem;
LPWSTR pszNodes = NULL;
BOOL bSuccess = FALSE;
LPWSTR s;
{
WCHAR buf[MAX_NEW_KEY_LEN];
HTREEITEM hNewItem = 0;
- TVITEMEX item;
+ TVITEMEXW item;
/* Default to the current selection */
if (!hItem)
static BOOL InitTreeViewItems(HWND hwndTV, LPWSTR pHostName)
{
- TVITEM tvi;
- TVINSERTSTRUCT tvins;
+ TVITEMW tvi;
+ TVINSERTSTRUCTW tvins;
HTREEITEM hRoot;
tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN | TVIF_PARAM;
do
{
wsprintf(szNewKey, szNewKeyFormat, iIndex++);
- nResult = RegCreateKeyExW(hKey, szNewKey, 0, NULL, 0, KEY_WRITE, NULL, &hNewKey, &dwDisposition);
+ nResult = RegCreateKeyExW(hKey, szNewKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hNewKey, &dwDisposition);
if (hNewKey && dwDisposition == REG_OPENED_EXISTING_KEY)
{
RegCloseKey(hNewKey);
WCHAR szPathPart[128];
WCHAR szBuffer[128];
LPCWSTR s;
- TVITEM tvi;
+ TVITEMW tvi;
/* Load "My Computer" string... */
LoadStringW(hInst, IDS_MY_COMPUTER, szBuffer, COUNT_OF(szBuffer));
while(keyPath[0])
{
s = wcschr(keyPath, L'\\');
- wcsncpy(szPathPart, keyPath, s ? s - keyPath + 1 : wcslen(keyPath) + 1);
+ lstrcpynW(szPathPart, keyPath, s ? s - keyPath + 1 : wcslen(keyPath) + 1);
/* Special case for root to expand root key abbreviations */
if (hItem == hRoot)
{
- if (!wcsicmp(szPathPart, L"HKCR"))
+ if (!_wcsicmp(szPathPart, L"HKCR"))
wcscpy(szPathPart, L"HKEY_CLASSES_ROOT");
- else if (!wcsicmp(szPathPart, L"HKCU"))
+ else if (!_wcsicmp(szPathPart, L"HKCU"))
wcscpy(szPathPart, L"HKEY_CURRENT_USER");
- else if (!wcsicmp(szPathPart, L"HKLM"))
+ else if (!_wcsicmp(szPathPart, L"HKLM"))
wcscpy(szPathPart, L"HKEY_LOCAL_MACHINE");
- else if (!wcsicmp(szPathPart, L"HKU"))
+ else if (!_wcsicmp(szPathPart, L"HKU"))
wcscpy(szPathPart, L"HKEY_USERS");
- else if (!wcsicmp(szPathPart, L"HKCC"))
+ else if (!_wcsicmp(szPathPart, L"HKCC"))
wcscpy(szPathPart, L"HKEY_CURRENT_CONFIG");
- else if (!wcsicmp(szPathPart, L"HKDD"))
+ else if (!_wcsicmp(szPathPart, L"HKDD"))
wcscpy(szPathPart, L"HKEY_DYN_DATA");
}
(void)TreeView_GetItem(hwndTV, &tvi);
- if (!wcsicmp(szBuffer, szPathPart))
+ if (!_wcsicmp(szBuffer, szPathPart))
break;
}