Home | Info | Community | Development | myReactOS | Contact Us
[static]
Definition at line 86 of file userprops.c.
Referenced by UserProfilePageProc().
{ PUSER_INFO_3 pUserInfo = NULL; LPTSTR pszProfilePath = NULL; LPTSTR pszScriptPath = NULL; LPTSTR pszHomeDir = NULL; LPTSTR pszHomeDrive = NULL; NET_API_STATUS status; #if 0 DWORD dwIndex; #endif INT nLength; INT nIndex; NetUserGetInfo(NULL, pUserData->szUserName, 3, (LPBYTE*)&pUserInfo); /* Get the profile path */ nLength = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_USER_PROFILE_PATH)); if (nLength == 0) { pUserInfo->usri3_profile = NULL; } else { pszProfilePath = HeapAlloc(GetProcessHeap(), 0, (nLength + 1) * sizeof(TCHAR)); GetDlgItemText(hwndDlg, IDC_USER_PROFILE_PATH, pszProfilePath, nLength + 1); pUserInfo->usri3_profile = pszProfilePath; } /* Get the script path */ nLength = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_USER_PROFILE_SCRIPT)); if (nLength == 0) { pUserInfo->usri3_script_path = NULL; } else { pszScriptPath = HeapAlloc(GetProcessHeap(), 0, (nLength + 1) * sizeof(TCHAR)); GetDlgItemText(hwndDlg, IDC_USER_PROFILE_SCRIPT, pszScriptPath, nLength + 1); pUserInfo->usri3_script_path = pszScriptPath; } if (IsDlgButtonChecked(hwndDlg, IDC_USER_PROFILE_LOCAL) == BST_CHECKED) { /* Local home directory */ nLength = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_USER_PROFILE_LOCAL_PATH)); if (nLength == 0) { pUserInfo->usri3_home_dir = NULL; } else { pszHomeDir = HeapAlloc(GetProcessHeap(), 0, (nLength + 1) * sizeof(TCHAR)); GetDlgItemText(hwndDlg, IDC_USER_PROFILE_LOCAL_PATH, pszHomeDir, nLength + 1); pUserInfo->usri3_home_dir = pszHomeDir; } } else { /* Remote home directory */ nLength = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_USER_PROFILE_REMOTE_PATH)); if (nLength == 0) { pUserInfo->usri3_home_dir = NULL; } else { pszHomeDir = HeapAlloc(GetProcessHeap(), 0, (nLength + 1) * sizeof(TCHAR)); GetDlgItemText(hwndDlg, IDC_USER_PROFILE_REMOTE_PATH, pszHomeDir, nLength + 1); pUserInfo->usri3_home_dir = pszHomeDir; } nIndex = SendMessage(GetDlgItem(hwndDlg, IDC_USER_PROFILE_DRIVE), CB_GETCURSEL, 0, 0); if (nIndex != CB_ERR) { nLength = SendMessage(GetDlgItem(hwndDlg, IDC_USER_PROFILE_DRIVE), CB_GETLBTEXTLEN, nIndex, 0); pszHomeDrive = HeapAlloc(GetProcessHeap(), 0, (nLength + 1) * sizeof(TCHAR)); SendMessage(GetDlgItem(hwndDlg, IDC_USER_PROFILE_DRIVE), CB_GETLBTEXT, nIndex, (LPARAM)pszHomeDrive); pUserInfo->usri3_home_dir_drive = pszHomeDrive; } } #if 0 status = NetUserSetInfo(NULL, pUserData->szUserName, 3, (LPBYTE)pUserInfo, &dwIndex); if (status != NERR_Success) { DebugPrintf(_T("Status: %lu Index: %lu"), status, dwIndex); } #else status = NERR_Success; #endif if (pszProfilePath) HeapFree(GetProcessHeap(), 0, pszProfilePath); if (pszScriptPath) HeapFree(GetProcessHeap(), 0, pszScriptPath); if (pszHomeDir) HeapFree(GetProcessHeap(), 0, pszHomeDir); if (pszHomeDrive) HeapFree(GetProcessHeap(), 0, pszHomeDrive); NetApiBufferFree(pUserInfo); return (status == NERR_Success); }