42 if (pszRawBuffer ==
NULL)
48 if (pszCookedBuffer ==
NULL)
51 swprintf(pszCookedBuffer, pszRawBuffer, pProfileData->pszFullName);
62 if (pszCookedBuffer !=
NULL)
65 if (pszRawBuffer !=
NULL)
115 DPRINT(
"ChangeUserProfileType(%p)\n", hwndDlg);
127 Item.iItem = iSelected;
131 if (
Item.lParam == 0)
158 DPRINT(
"DeleteUserProfile()\n");
170 Item.iItem = iSelected;
174 if (
Item.lParam == 0)
238 DPRINT(
"CopyUserProfile()\n");
250 Item.iItem = iSelected;
254 if (
Item.lParam == 0)
330 DWORD dwProfilePathLength;
334 dwProfilePathLength =
wcslen(pszProfilePath);
336 wcscat(pszProfilePath,
L"\\*.*");
352 if ((
_wcsicmp(FindData.cFileName,
L".") == 0) ||
353 (
_wcsicmp(FindData.cFileName,
L"..") == 0))
357 wcscat(pszProfilePath, FindData.cFileName);
367 Size.u.LowPart = FindData.nFileSizeLow;
368 Size.u.HighPart = FindData.nFileSizeHigh;
369 *pullProfileSize +=
Size.QuadPart;
392 WCHAR szAccountName[128], szDomainName[128];
393 DWORD dwAccountNameSize, dwDomainNameSize;
396 dwAccountNameSize =
ARRAYSIZE(szAccountName);
397 dwDomainNameSize =
ARRAYSIZE(szDomainName);
408 *pbUnknownProfile =
TRUE;
424 wsprintf(pszNameBuffer,
L"%s\\%s", szDomainName, szAccountName);
426 *pbUnknownProfile =
FALSE;
440 WCHAR szNameBuffer[256];
442 DWORD dwProfileData,
dwSize, dwType, dwState = 0, dwRefCount = 0;
443 DWORD dwProfilePathLength;
451 BOOL bUnknownProfile;
460 (
LPBYTE)szTempProfilePath,
478 dwProfilePathLength =
wcslen(szProfilePath);
481 wcscat(szProfilePath,
L"\\ntuser.dat");
490 ullProfileSize = 0
ULL;
513 dwSize =
sizeof(dwRefCount);
531 if (pProfileData ==
NULL)
535 pProfileData->
dwState = dwState;
548 memset(&lvi, 0x00,
sizeof(lvi));
552 lvi.lParam = (
LPARAM)pProfileData;
560 if (dwState & 0x0010)
570 if (dwState & 0x0001)
572 else if (dwState & 0x0010)
615 Item.iItem = iSelected;
618 if (
Item.lParam != 0)
654 WCHAR szProfileSid[64];
673 if (pTokenUser ==
NULL)
680 L"Software\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList",
688 for (dwIndex = 0; ; dwIndex++)
748 if (pTokenUser !=
NULL)
VOID ResourceMessageBox(HINSTANCE hInstance, HWND hwnd, UINT uType, UINT uCaptionId, UINT uMessageId)
#define RegCloseKey(hKey)
#define ERROR_INSUFFICIENT_BUFFER
#define IDS_USERPROFILE_TYPE
#define IDS_USERPROFILE_ACCOUNT_DELETED
#define IDC_USERPROFILE_DELETE
#define IDS_USERPROFILE_LOCAL
#define IDS_USERPROFILE_MANDATORY
#define IDD_USERPROFILE_TYPE
#define IDC_USERPROFILE_LIST
#define IDC_USERPROFILE_TYPE_TEXT
#define IDD_USERPROFILE_COPY
#define IDC_USERPROFILE_TYPE_LOCAL
#define IDS_USERPROFILE_STATUS
#define IDS_USERPROFILE_MODIFIED
#define IDS_USERPROFILE_TYPE_TEXT
#define IDS_USERPROFILE_CONFIRM_DELETE_TITLE
#define IDC_USERPROFILE_TYPE_ROAMING
#define IDS_USERPROFILE_SIZE
#define IDS_USERPROFILE_ACCOUNT_UNKNOWN
#define IDS_USERPROFILE_CONFIRM_DELETE
#define IDC_USERPROFILE_CHANGE
#define IDC_USERPROFILE_COPY
#define IDC_USERACCOUNT_LINK
#define IDS_USERPROFILE_NAME
#define IDS_USERPROFILE_ROAMING
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
BOOL WINAPI LookupAccountSidW(LPCWSTR pSystemName, PSID pSid, LPWSTR pAccountName, LPDWORD pdwAccountName, LPWSTR pDomainName, LPDWORD pdwDomainName, PSID_NAME_USE peUse)
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
BOOL WINAPI ConvertSidToStringSidW(PSID Sid, LPWSTR *StringSid)
#define INVALID_HANDLE_VALUE
#define GetCurrentProcess()
#define HeapFree(x, y, z)
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
BOOL WINAPI FindClose(HANDLE hFindFile)
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
enum _SID_NAME_USE SID_NAME_USE
#define ERROR_FILE_NOT_FOUND
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
static BOOL IsUserAdmin(VOID)
#define FILE_ATTRIBUTE_DIRECTORY
#define LOCALE_USER_DEFAULT
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
#define ListView_InsertItem(hwnd, pitem)
#define ListView_SetItemState(hwndLV, i, data, mask)
#define ListView_InsertColumn(hwnd, iCol, pcol)
#define ListView_GetNextItem(hwnd, i, flags)
#define LVS_EX_FULLROWSELECT
#define ListView_GetItemCount(hwnd)
#define ListView_GetSelectedCount(hwndLV)
struct tagNMLISTVIEW * LPNMLISTVIEW
#define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_)
#define ListView_GetItem(hwnd, pitem)
#define LVM_SETEXTENDEDLISTVIEWSTYLE
#define ConvertStringSidToSid
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
INT_PTR CALLBACK UserProfileDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
static INT_PTR CALLBACK UserProfileTypeDlgProc(_In_ HWND hwndDlg, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam)
static VOID OnInitUserProfileDialog(HWND hwndDlg)
struct _PROFILEDATA * PPROFILEDATA
static VOID UpdateButtonState(_In_ HWND hwndDlg, _In_ HWND hwndListView)
static VOID AddUserProfiles(_In_ HWND hwndDlg, _In_ HWND hwndListView, _In_ BOOL bAdmin)
static BOOL GetProfileSize(_In_ PWSTR pszProfilePath, _Inout_ PULONGLONG pullProfileSize)
static BOOL OnProfileTypeInit(_In_ HWND hwndDlg, _In_ PPROFILEDATA pProfileData)
static BOOL ChangeUserProfileType(_In_ HWND hwndDlg)
static BOOL GetProfileName(_In_ PSID pProfileSid, _In_ DWORD dwNameBufferSize, _Out_ PWSTR pszNameBuffer, _Out_ PBOOL pbUnknownProfile)
static VOID SetListViewColumns(_In_ HWND hwndListView)
static BOOL CopyUserProfile(_In_ HWND hwndDlg)
static INT_PTR CALLBACK CopyUserProfileDlgProc(_In_ HWND hwndDlg, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam)
static VOID OnNotify(_In_ HWND hwndDlg, _In_ NMHDR *nmhdr)
static BOOL DeleteUserProfile(_In_ HWND hwndDlg)
struct _PROFILEDATA PROFILEDATA
static VOID AddUserProfile(_In_ HWND hwndListView, _In_ PSID pProfileSid, _In_ HKEY hProfileKey)
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
DWORD WINAPI GetLastError(void)
#define Button_SetCheck(hwndCtl, check)
#define ERROR_PATH_NOT_FOUND
#define HKEY_LOCAL_MACHINE
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)