diff --git a/reactos/base/applications/mstsc/connectdialog.c b/reactos/base/applications/mstsc/connectdialog.c index f408b153496..1c929f40540 100644 --- a/reactos/base/applications/mstsc/connectdialog.c +++ b/reactos/base/applications/mstsc/connectdialog.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include "resource.h" @@ -49,10 +48,10 @@ typedef struct _SETTINGS_ENTRY typedef struct _DISPLAY_DEVICE_ENTRY { struct _DISPLAY_DEVICE_ENTRY *Flink; - LPTSTR DeviceDescription; - LPTSTR DeviceName; - LPTSTR DeviceKey; - LPTSTR DeviceID; + LPWSTR DeviceDescription; + LPWSTR DeviceName; + LPWSTR DeviceKey; + LPWSTR DeviceID; DWORD DeviceStateFlags; PSETTINGS_ENTRY Settings; /* sorted by increasing dmPelsHeight, BPP */ DWORD SettingsCount; @@ -82,7 +81,6 @@ typedef struct _INFO } INFO, *PINFO; HINSTANCE hInst; -extern char g_servername[]; static VOID OnTabWndSelChange(PINFO pInfo) @@ -107,56 +105,56 @@ static VOID FillServerAddesssCombo(PINFO pInfo) { HKEY hKey; - TCHAR KeyName[] = _T("Software\\Microsoft\\Terminal Server Client\\Default"); - TCHAR Name[MAX_KEY_NAME]; + WCHAR KeyName[] = L"Software\\Microsoft\\Terminal Server Client\\Default"; + WCHAR Name[MAX_KEY_NAME]; LONG ret = ERROR_SUCCESS; DWORD size; INT i = 0; - if (RegOpenKeyEx(HKEY_CURRENT_USER, - KeyName, - 0, - KEY_READ, - &hKey) == ERROR_SUCCESS) + if (RegOpenKeyExW(HKEY_CURRENT_USER, + KeyName, + 0, + KEY_READ, + &hKey) == ERROR_SUCCESS) { while (ret == ERROR_SUCCESS) { size = MAX_KEY_NAME; - ret = RegEnumValue(hKey, - i, - Name, - &size, - NULL, - NULL, - NULL, - NULL); + ret = RegEnumValueW(hKey, + i, + Name, + &size, + NULL, + NULL, + NULL, + NULL); if (ret == ERROR_SUCCESS) { size = MAX_KEY_NAME; - if (RegQueryValueEx(hKey, - Name, - 0, - NULL, - NULL, - &size) == ERROR_SUCCESS) + if (RegQueryValueExW(hKey, + Name, + 0, + NULL, + NULL, + &size) == ERROR_SUCCESS) { - LPTSTR lpAddress = HeapAlloc(GetProcessHeap(), + LPWSTR lpAddress = HeapAlloc(GetProcessHeap(), 0, size); if (lpAddress) { - if (RegQueryValueEx(hKey, - Name, - 0, - NULL, - lpAddress, - &size) == ERROR_SUCCESS) + if (RegQueryValueExW(hKey, + Name, + 0, + NULL, + (LPBYTE)lpAddress, + &size) == ERROR_SUCCESS) { - SendDlgItemMessage(pInfo->hGeneralPage, - IDC_SERVERCOMBO, - CB_ADDSTRING, - 0, - (LPARAM)lpAddress); + SendDlgItemMessageW(pInfo->hGeneralPage, + IDC_SERVERCOMBO, + CB_ADDSTRING, + 0, + (LPARAM)lpAddress); } HeapFree(GetProcessHeap(), @@ -170,16 +168,16 @@ FillServerAddesssCombo(PINFO pInfo) } } - if (LoadString(hInst, - IDS_BROWSESERVER, - Name, - sizeof(Name) / sizeof(TCHAR))) + if (LoadStringW(hInst, + IDS_BROWSESERVER, + Name, + sizeof(Name) / sizeof(WCHAR))) { - SendDlgItemMessage(pInfo->hGeneralPage, - IDC_SERVERCOMBO, - CB_ADDSTRING, - 0, - (LPARAM)Name); + SendDlgItemMessageW(pInfo->hGeneralPage, + IDC_SERVERCOMBO, + CB_ADDSTRING, + 0, + (LPARAM)Name); } } @@ -197,34 +195,34 @@ GeneralOnInit(PINFO pInfo) 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER); - pInfo->hLogon = LoadImage(hInst, - MAKEINTRESOURCE(IDI_LOGON), + pInfo->hLogon = LoadImageW(hInst, + MAKEINTRESOURCEW(IDI_LOGON), + IMAGE_ICON, + 32, + 32, + LR_DEFAULTCOLOR); + if (pInfo->hLogon) + { + SendDlgItemMessageW(pInfo->hGeneralPage, + IDC_LOGONICON, + STM_SETICON, + (WPARAM)pInfo->hLogon, + 0); + } + + pInfo->hConn = LoadImageW(hInst, + MAKEINTRESOURCEW(IDI_CONN), IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR); - if (pInfo->hLogon) - { - SendDlgItemMessage(pInfo->hGeneralPage, - IDC_LOGONICON, - STM_SETICON, - (WPARAM)pInfo->hLogon, - 0); - } - - pInfo->hConn = LoadImage(hInst, - MAKEINTRESOURCE(IDI_CONN), - IMAGE_ICON, - 32, - 32, - LR_DEFAULTCOLOR); if (pInfo->hConn) { - SendDlgItemMessage(pInfo->hGeneralPage, - IDC_CONNICON, - STM_SETICON, - (WPARAM)pInfo->hConn, - 0); + SendDlgItemMessageW(pInfo->hGeneralPage, + IDC_CONNICON, + STM_SETICON, + (WPARAM)pInfo->hConn, + 0); } FillServerAddesssCombo(pInfo); @@ -248,8 +246,8 @@ GeneralDlgProc(HWND hDlg, WPARAM wParam, LPARAM lParam) { - PINFO pInfo = (PINFO)GetWindowLongPtr(GetParent(hDlg), - GWLP_USERDATA); + PINFO pInfo = (PINFO)GetWindowLongPtrW(GetParent(hDlg), + GWLP_USERDATA); switch (message) { @@ -267,20 +265,20 @@ GeneralDlgProc(HWND hDlg, { INT last, cur; - cur = SendDlgItemMessage(hDlg, - IDC_SERVERCOMBO, - CB_GETCURSEL, - 0, - 0); - cur++; - - last = SendDlgItemMessage(hDlg, + cur = SendDlgItemMessageW(hDlg, IDC_SERVERCOMBO, - CB_GETCOUNT, + CB_GETCURSEL, 0, 0); + cur++; + + last = SendDlgItemMessageW(hDlg, + IDC_SERVERCOMBO, + CB_GETCOUNT, + 0, + 0); if (cur == last) - MessageBox(hDlg, _T("SMB is not yet supported"), _T("RDP error"), MB_ICONERROR); + MessageBoxW(hDlg, L"SMB is not yet supported", L"RDP error", MB_ICONERROR); } break; @@ -309,11 +307,11 @@ GeneralDlgProc(HWND hDlg, static PSETTINGS_ENTRY -GetPossibleSettings(IN LPCTSTR DeviceName, +GetPossibleSettings(IN LPCWSTR lpDeviceName, OUT DWORD* pSettingsCount, OUT PSETTINGS_ENTRY* CurrentSettings) { - DEVMODE devmode; + DEVMODEW devmode; DWORD NbSettings = 0; DWORD iMode = 0; DWORD dwFlags = 0; @@ -324,7 +322,7 @@ GetPossibleSettings(IN LPCTSTR DeviceName, /* Get current settings */ *CurrentSettings = NULL; - hDC = CreateIC(NULL, DeviceName, NULL, NULL); + hDC = CreateICW(NULL, lpDeviceName, NULL, NULL); bpp = GetDeviceCaps(hDC, PLANES); bpp *= GetDeviceCaps(hDC, BITSPIXEL); xres = GetDeviceCaps(hDC, HORZRES); @@ -335,10 +333,10 @@ GetPossibleSettings(IN LPCTSTR DeviceName, devmode.dmSize = (WORD)sizeof(DEVMODE); devmode.dmDriverExtra = 0; - if (!EnumDisplaySettingsEx(DeviceName, ENUM_CURRENT_SETTINGS, &devmode, dwFlags)) + if (!EnumDisplaySettingsExW(lpDeviceName, ENUM_CURRENT_SETTINGS, &devmode, dwFlags)) return NULL; - while (EnumDisplaySettingsEx(DeviceName, iMode, &devmode, dwFlags)) + while (EnumDisplaySettingsExW(lpDeviceName, iMode, &devmode, dwFlags)) { if (devmode.dmBitsPerPel==8 || devmode.dmBitsPerPel==16 || @@ -399,13 +397,13 @@ GetPossibleSettings(IN LPCTSTR DeviceName, static BOOL -AddDisplayDevice(PINFO pInfo, PDISPLAY_DEVICE DisplayDevice) +AddDisplayDevice(PINFO pInfo, PDISPLAY_DEVICEW DisplayDevice) { PDISPLAY_DEVICE_ENTRY newEntry = NULL; - LPTSTR description = NULL; - LPTSTR name = NULL; - LPTSTR key = NULL; - LPTSTR devid = NULL; + LPWSTR description = NULL; + LPWSTR name = NULL; + LPWSTR key = NULL; + LPWSTR devid = NULL; DWORD descriptionSize, nameSize, keySize, devidSize; PSETTINGS_ENTRY Current; DWORD ResolutionsCount = 1; @@ -457,19 +455,19 @@ AddDisplayDevice(PINFO pInfo, PDISPLAY_DEVICE DisplayDevice) i++; } } - descriptionSize = (_tcslen(DisplayDevice->DeviceString) + 1) * sizeof(TCHAR); + descriptionSize = (wcslen(DisplayDevice->DeviceString) + 1) * sizeof(WCHAR); description = HeapAlloc(GetProcessHeap(), 0, descriptionSize); if (!description) goto ByeBye; - nameSize = (_tcslen(DisplayDevice->DeviceName) + 1) * sizeof(TCHAR); + nameSize = (wcslen(DisplayDevice->DeviceName) + 1) * sizeof(WCHAR); name = HeapAlloc(GetProcessHeap(), 0, nameSize); if (!name) goto ByeBye; - keySize = (_tcslen(DisplayDevice->DeviceKey) + 1) * sizeof(TCHAR); + keySize = (wcslen(DisplayDevice->DeviceKey) + 1) * sizeof(WCHAR); key = HeapAlloc(GetProcessHeap(), 0, keySize); if (!key) goto ByeBye; - devidSize = (_tcslen(DisplayDevice->DeviceID) + 1) * sizeof(TCHAR); + devidSize = (wcslen(DisplayDevice->DeviceID) + 1) * sizeof(WCHAR); devid = HeapAlloc(GetProcessHeap(), 0, devidSize); if (!devid) goto ByeBye; @@ -516,9 +514,9 @@ ByeBye: static VOID -OnResolutionChanged(PINFO pInfo, DWORD position) +OnResolutionChanged(PINFO pInfo, INT position) { - TCHAR Buffer[64]; + WCHAR Buffer[64]; INT MaxSlider; MaxSlider = SendDlgItemMessageW(pInfo->hDisplayPage, @@ -529,33 +527,33 @@ OnResolutionChanged(PINFO pInfo, DWORD position) if (position == MaxSlider) { - LoadString(hInst, - IDS_FULLSCREEN, - Buffer, - sizeof(Buffer) / sizeof(TCHAR)); + LoadStringW(hInst, + IDS_FULLSCREEN, + Buffer, + sizeof(Buffer) / sizeof(WCHAR)); } else { - TCHAR Pixel[64]; + WCHAR Pixel[64]; - if (LoadString(hInst, - IDS_PIXEL, - Pixel, - sizeof(Pixel) / sizeof(TCHAR))) + if (LoadStringW(hInst, + IDS_PIXEL, + Pixel, + sizeof(Pixel) / sizeof(WCHAR))) { - _stprintf(Buffer, - Pixel, - pInfo->DisplayDeviceList->Resolutions[position].dmPelsWidth, - pInfo->DisplayDeviceList->Resolutions[position].dmPelsHeight, - Pixel); + _swprintf(Buffer, + Pixel, + pInfo->DisplayDeviceList->Resolutions[position].dmPelsWidth, + pInfo->DisplayDeviceList->Resolutions[position].dmPelsHeight, + Pixel); } } - SendDlgItemMessage(pInfo->hDisplayPage, - IDC_SETTINGS_RESOLUTION_TEXT, - WM_SETTEXT, - 0, - (LPARAM)Buffer); + SendDlgItemMessageW(pInfo->hDisplayPage, + IDC_SETTINGS_RESOLUTION_TEXT, + WM_SETTEXT, + 0, + (LPARAM)Buffer); /* save new settings */ SetIntegerToSettings(pInfo->pRdpSettings, @@ -572,8 +570,8 @@ static VOID FillResolutionsAndColors(PINFO pInfo) { PSETTINGS_ENTRY Current; - TCHAR Buffer[64]; - TCHAR Pixel[64]; + WCHAR Buffer[64]; + WCHAR Pixel[64]; DWORD index, i, num; DWORD MaxBpp = 0; DWORD width, height; @@ -582,11 +580,11 @@ FillResolutionsAndColors(PINFO pInfo) pInfo->CurrentDisplayDevice = pInfo->DisplayDeviceList; /* Update global variable */ /* find max bpp */ - SendDlgItemMessage(pInfo->hDisplayPage, - IDC_BPPCOMBO, - CB_RESETCONTENT, - 0, - 0); + SendDlgItemMessageW(pInfo->hDisplayPage, + IDC_BPPCOMBO, + CB_RESETCONTENT, + 0, + 0); for (Current = pInfo->DisplayDeviceList->Settings; Current != NULL; Current = Current->Flink) { if (Current->dmBitsPerPel > MaxBpp) @@ -598,6 +596,7 @@ FillResolutionsAndColors(PINFO pInfo) case 24: num = 4; break; case 16: num = 3; break; case 8: num = 1; break; + default: num = 0; break; } types[0] = IDS_256COLORS; @@ -606,54 +605,54 @@ FillResolutionsAndColors(PINFO pInfo) types[3] = IDS_HIGHCOLOR24; /* Fill color depths combo box */ - SendDlgItemMessage(pInfo->hDisplayPage, - IDC_BPPCOMBO, - CB_RESETCONTENT, - 0, - 0); + SendDlgItemMessageW(pInfo->hDisplayPage, + IDC_BPPCOMBO, + CB_RESETCONTENT, + 0, + 0); for (i = 0, Current = pInfo->DisplayDeviceList->Settings; i <= num && Current != NULL; i++, Current = Current->Flink) { - TCHAR Buffer[64]; - if (LoadString(hInst, - types[i], - Buffer, - sizeof(Buffer) / sizeof(TCHAR))) + WCHAR Buffer[64]; + if (LoadStringW(hInst, + types[i], + Buffer, + sizeof(Buffer) / sizeof(WCHAR))) { - index = (DWORD)SendDlgItemMessage(pInfo->hDisplayPage, - IDC_BPPCOMBO, - CB_FINDSTRINGEXACT, - -1, - (LPARAM)Buffer); + index = (DWORD)SendDlgItemMessageW(pInfo->hDisplayPage, + IDC_BPPCOMBO, + CB_FINDSTRINGEXACT, + (WPARAM)-1, + (LPARAM)Buffer); if (index == (DWORD)CB_ERR) { - index = (DWORD)SendDlgItemMessage(pInfo->hDisplayPage, - IDC_BPPCOMBO, - CB_ADDSTRING, - 0, - (LPARAM)Buffer); - SendDlgItemMessage(pInfo->hDisplayPage, - IDC_BPPCOMBO, - CB_SETITEMDATA, - index, - types[i]); + index = (DWORD)SendDlgItemMessageW(pInfo->hDisplayPage, + IDC_BPPCOMBO, + CB_ADDSTRING, + 0, + (LPARAM)Buffer); + SendDlgItemMessageW(pInfo->hDisplayPage, + IDC_BPPCOMBO, + CB_SETITEMDATA, + index, + types[i]); } } } /* Fill resolutions slider */ - SendDlgItemMessage(pInfo->hDisplayPage, - IDC_GEOSLIDER, - TBM_CLEARTICS, - TRUE, - 0); - SendDlgItemMessage(pInfo->hDisplayPage, - IDC_GEOSLIDER, - TBM_SETRANGE, - TRUE, - MAKELONG(0, pInfo->DisplayDeviceList->ResolutionsCount)); //extra 1 for full screen + SendDlgItemMessageW(pInfo->hDisplayPage, + IDC_GEOSLIDER, + TBM_CLEARTICS, + TRUE, + 0); + SendDlgItemMessageW(pInfo->hDisplayPage, + IDC_GEOSLIDER, + TBM_SETRANGE, + TRUE, + MAKELONG(0, pInfo->DisplayDeviceList->ResolutionsCount)); //extra 1 for full screen width = GetIntegerFromSettings(pInfo->pRdpSettings, L"desktopwidth"); height = GetIntegerFromSettings(pInfo->pRdpSettings, L"desktopheight"); @@ -665,30 +664,30 @@ FillResolutionsAndColors(PINFO pInfo) if (pInfo->CurrentDisplayDevice->Resolutions[index].dmPelsWidth == width && pInfo->CurrentDisplayDevice->Resolutions[index].dmPelsHeight == height) { - SendDlgItemMessage(pInfo->hDisplayPage, - IDC_GEOSLIDER, - TBM_SETPOS, - TRUE, - index); + SendDlgItemMessageW(pInfo->hDisplayPage, + IDC_GEOSLIDER, + TBM_SETPOS, + TRUE, + index); break; } } - if (LoadString(hInst, - IDS_PIXEL, - Pixel, - sizeof(Pixel) / sizeof(TCHAR))) + if (LoadStringW(hInst, + IDS_PIXEL, + Pixel, + sizeof(Pixel) / sizeof(WCHAR))) { - _stprintf(Buffer, + _swprintf(Buffer, Pixel, width, height, Pixel); - SendDlgItemMessage(pInfo->hDisplayPage, - IDC_SETTINGS_RESOLUTION_TEXT, - WM_SETTEXT, - 0, - (LPARAM)Buffer); + SendDlgItemMessageW(pInfo->hDisplayPage, + IDC_SETTINGS_RESOLUTION_TEXT, + WM_SETTEXT, + 0, + (LPARAM)Buffer); } } } @@ -697,7 +696,7 @@ FillResolutionsAndColors(PINFO pInfo) static VOID DisplayOnInit(PINFO pInfo) { - DISPLAY_DEVICE displayDevice; + DISPLAY_DEVICEW displayDevice; DWORD iDevNum = 0; BOOL GotDev = FALSE; @@ -709,52 +708,52 @@ DisplayOnInit(PINFO pInfo) 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER); - pInfo->hRemote = LoadImage(hInst, - MAKEINTRESOURCE(IDI_REMOTE), + pInfo->hRemote = LoadImageW(hInst, + MAKEINTRESOURCEW(IDI_REMOTE), + IMAGE_ICON, + 32, + 32, + LR_DEFAULTCOLOR); + if (pInfo->hRemote) + { + SendDlgItemMessageW(pInfo->hDisplayPage, + IDC_REMICON, + STM_SETICON, + (WPARAM)pInfo->hRemote, + 0); + } + + pInfo->hColor = LoadImageW(hInst, + MAKEINTRESOURCEW(IDI_COLORS), IMAGE_ICON, 32, 32, - LR_DEFAULTCOLOR); - if (pInfo->hRemote) - { - SendDlgItemMessage(pInfo->hDisplayPage, - IDC_REMICON, - STM_SETICON, - (WPARAM)pInfo->hRemote, - 0); - } - - pInfo->hColor = LoadImage(hInst, - MAKEINTRESOURCE(IDI_COLORS), - IMAGE_ICON, - 32, - 32, LR_DEFAULTCOLOR); if (pInfo->hColor) { - SendDlgItemMessage(pInfo->hDisplayPage, - IDC_COLORSICON, - STM_SETICON, - (WPARAM)pInfo->hColor, - 0); + SendDlgItemMessageW(pInfo->hDisplayPage, + IDC_COLORSICON, + STM_SETICON, + (WPARAM)pInfo->hColor, + 0); } - pInfo->hSpectrum = LoadImage(hInst, - MAKEINTRESOURCE(IDB_SPECT), - IMAGE_BITMAP, - 0, - 0, - LR_DEFAULTCOLOR); + pInfo->hSpectrum = LoadImageW(hInst, + MAKEINTRESOURCEW(IDB_SPECT), + IMAGE_BITMAP, + 0, + 0, + LR_DEFAULTCOLOR); if (pInfo->hSpectrum) { - GetObject(pInfo->hSpectrum, - sizeof(BITMAP), - &pInfo->bitmap); + GetObjectW(pInfo->hSpectrum, + sizeof(BITMAP), + &pInfo->bitmap); } /* Get video cards list */ displayDevice.cb = (DWORD)sizeof(DISPLAY_DEVICE); - while (EnumDisplayDevices(NULL, iDevNum, &displayDevice, 0x1)) + while (EnumDisplayDevicesW(NULL, iDevNum, &displayDevice, 0x1)) { if ((displayDevice.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) != 0) { @@ -774,25 +773,25 @@ DisplayOnInit(PINFO pInfo) /* set color combo */ bpp = GetIntegerFromSettings(pInfo->pRdpSettings, L"session bpp"); - num = SendDlgItemMessage(pInfo->hDisplayPage, - IDC_BPPCOMBO, - CB_GETCOUNT, - 0, - 0); + num = SendDlgItemMessageW(pInfo->hDisplayPage, + IDC_BPPCOMBO, + CB_GETCOUNT, + 0, + 0); for (i = 0; i < num; i++) { - INT data = SendDlgItemMessage(pInfo->hDisplayPage, - IDC_BPPCOMBO, - CB_GETITEMDATA, - i, - 0); + INT data = SendDlgItemMessageW(pInfo->hDisplayPage, + IDC_BPPCOMBO, + CB_GETITEMDATA, + i, + 0); if (data == bpp) { - SendDlgItemMessage(pInfo->hDisplayPage, - IDC_BPPCOMBO, - CB_SETCURSEL, - i, - 0); + SendDlgItemMessageW(pInfo->hDisplayPage, + IDC_BPPCOMBO, + CB_SETCURSEL, + i, + 0); bSet = TRUE; break; } @@ -800,11 +799,11 @@ DisplayOnInit(PINFO pInfo) if (!bSet) { - SendDlgItemMessage(pInfo->hDisplayPage, - IDC_BPPCOMBO, - CB_SETCURSEL, - num - 1, - 0); + SendDlgItemMessageW(pInfo->hDisplayPage, + IDC_BPPCOMBO, + CB_SETCURSEL, + num - 1, + 0); } } } @@ -816,8 +815,8 @@ DisplayDlgProc(HWND hDlg, WPARAM wParam, LPARAM lParam) { - PINFO pInfo = (PINFO)GetWindowLongPtr(GetParent(hDlg), - GWLP_USERDATA); + PINFO pInfo = (PINFO)GetWindowLongPtrW(GetParent(hDlg), + GWLP_USERDATA); switch (message) { @@ -866,7 +865,7 @@ DisplayDlgProc(HWND hDlg, case TB_BOTTOM: case TB_ENDTRACK: { - DWORD newPosition = (DWORD)SendDlgItemMessage(hDlg, IDC_GEOSLIDER, TBM_GETPOS, 0, 0); + INT newPosition = (DWORD)SendDlgItemMessageW(hDlg, IDC_GEOSLIDER, TBM_GETPOS, 0, 0); OnResolutionChanged(pInfo, newPosition); break; } @@ -904,7 +903,7 @@ OnMainCreate(HWND hwnd, PRDPSETTINGS pRdpSettings) { PINFO pInfo; - TCITEM item; + TCITEMW item; BOOL bRet = FALSE; pInfo = HeapAlloc(GetProcessHeap(), @@ -912,34 +911,36 @@ OnMainCreate(HWND hwnd, sizeof(INFO)); if (pInfo) { - SetWindowLongPtr(hwnd, - GWLP_USERDATA, - (LONG_PTR)pInfo); + SetWindowLongPtrW(hwnd, + GWLP_USERDATA, + (LONG_PTR)pInfo); /* add main settings pointer */ pInfo->pRdpSettings = pRdpSettings; - pInfo->hHeader = (HBITMAP)LoadImage(hInst, - MAKEINTRESOURCE(IDB_HEADER), - IMAGE_BITMAP, - 0, - 0, - LR_DEFAULTCOLOR); + pInfo->hHeader = (HBITMAP)LoadImageW(hInst, + MAKEINTRESOURCEW(IDB_HEADER), + IMAGE_BITMAP, + 0, + 0, + LR_DEFAULTCOLOR); if (pInfo->hHeader) { - GetObject(pInfo->hHeader, sizeof(BITMAP), &pInfo->headerbitmap); + GetObjectW(pInfo->hHeader, + sizeof(BITMAP), + &pInfo->headerbitmap); } pInfo->hTab = GetDlgItem(hwnd, IDC_TAB); if (pInfo->hTab) { - if (CreateDialog(hInst, - MAKEINTRESOURCE(IDD_GENERAL), - hwnd, - (DLGPROC)GeneralDlgProc)) + if (CreateDialogW(hInst, + MAKEINTRESOURCEW(IDD_GENERAL), + hwnd, + (DLGPROC)GeneralDlgProc)) { - char str[256]; - LoadString(hInst, IDS_TAB_GENERAL, str, 256); + WCHAR str[256]; + LoadStringW(hInst, IDS_TAB_GENERAL, str, 256); ZeroMemory(&item, sizeof(TCITEM)); item.mask = TCIF_TEXT; item.pszText = str; @@ -947,13 +948,13 @@ OnMainCreate(HWND hwnd, (void)TabCtrl_InsertItem(pInfo->hTab, 0, &item); } - if (CreateDialog(hInst, - MAKEINTRESOURCE(IDD_DISPLAY), - hwnd, - (DLGPROC)DisplayDlgProc)) + if (CreateDialogW(hInst, + MAKEINTRESOURCEW(IDD_DISPLAY), + hwnd, + (DLGPROC)DisplayDlgProc)) { - char str[256]; - LoadString(hInst, IDS_TAB_DISPLAY, str, 256); + WCHAR str[256]; + LoadStringW(hInst, IDS_TAB_DISPLAY, str, 256); ZeroMemory(&item, sizeof(TCITEM)); item.mask = TCIF_TEXT; item.pszText = str; @@ -978,8 +979,8 @@ DlgProc(HWND hDlg, PINFO pInfo; /* Get the window context */ - pInfo = (PINFO)GetWindowLongPtr(hDlg, - GWLP_USERDATA); + pInfo = (PINFO)GetWindowLongPtrW(hDlg, + GWLP_USERDATA); if (pInfo == NULL && Message != WM_INITDIALOG) { goto HandleDefaultMessage; @@ -1004,13 +1005,6 @@ DlgProc(HWND hDlg, EndDialog(hDlg, LOWORD(wParam)); } - - switch(LOWORD(wParam)) - { - - } - - break; } case WM_NOTIFY: @@ -1032,7 +1026,7 @@ DlgProc(HWND hDlg, case WM_PAINT: { PAINTSTRUCT ps; - HDC hdc, hdcMem; + HDC hdc; hdc = BeginPaint(hDlg, &ps); if (hdc != NULL) @@ -1080,6 +1074,7 @@ HandleDefaultMessage: return FALSE; } + BOOL OpenRDPConnectDialog(HINSTANCE hInstance, PRDPSETTINGS pRdpSettings) @@ -1092,9 +1087,9 @@ OpenRDPConnectDialog(HINSTANCE hInstance, iccx.dwICC = ICC_TAB_CLASSES; InitCommonControlsEx(&iccx); - return (DialogBoxParam(hInst, - MAKEINTRESOURCE(IDD_CONNECTDIALOG), - NULL, - (DLGPROC)DlgProc, - pRdpSettings) == IDOK); + return (DialogBoxParamW(hInst, + MAKEINTRESOURCEW(IDD_CONNECTDIALOG), + NULL, + (DLGPROC)DlgProc, + (LPARAM)pRdpSettings) == IDOK); } diff --git a/reactos/base/applications/mstsc/mstsc_vc8_auto.vcproj b/reactos/base/applications/mstsc/mstsc_vc8_auto.vcproj index e412024e0a0..e28d68ab87e 100644 --- a/reactos/base/applications/mstsc/mstsc_vc8_auto.vcproj +++ b/reactos/base/applications/mstsc/mstsc_vc8_auto.vcproj @@ -41,14 +41,14 @@ Optimization="0" WholeProgramOptimization="false" AdditionalIncludeDirectories="./;../../../.;../../../include;../../../include;../../../include/dxsdk;../../../include/ndk;../../../include/reactos;../../../include/reactos;../../../include/reactos/libs;..\..\..\obj-i386\include\reactos" - PreprocessorDefinitions=";DBG=1;KDBG=1;STDCALL=__stdcall;_DEBUG;_LIB;_M_IX86;_SEH_ENABLE_TRACE;_WIN32_IE=0x600;_WIN32_WINNT=0x501;_X86_;__REACTOS__;__i386__" + PreprocessorDefinitions="DBG=1;KDBG=1;STDCALL=__stdcall;_DEBUG;_LIB;_M_IX86;_SEH_ENABLE_TRACE;_WIN32_IE=0x600;_WIN32_WINNT=0x501;_X86_;__REACTOS__;__i386__;_CRT_SECURE_NO_DEPRECATE;UNICODE" MinimalRebuild="false" BasicRuntimeChecks="0" RuntimeLibrary="1" BufferSecurityCheck="false" EnableFunctionLevelLinking="false" UsePrecompiledHeader="0" - WarningLevel="3" + WarningLevel="4" Detect64BitPortabilityProblems="false" DebugInformationFormat="4" CallingConvention="0" diff --git a/reactos/base/applications/mstsc/rdpfile.c b/reactos/base/applications/mstsc/rdpfile.c index 6dfea4f8984..3314d98c3d4 100644 --- a/reactos/base/applications/mstsc/rdpfile.c +++ b/reactos/base/applications/mstsc/rdpfile.c @@ -1,6 +1,5 @@ #include #include -#include #include #include #include "resource.h" @@ -64,7 +63,7 @@ SetStringToSettings(PRDPSETTINGS pRdpSettings, { if (pRdpSettings->pSettings[i].Type == L's') { - wcscpy(pRdpSettings->pSettings[i].Value.i, lpValue); + wcscpy(pRdpSettings->pSettings[i].Value.s, lpValue); bRet = TRUE; break; } @@ -184,7 +183,7 @@ ParseSettings(PRDPSETTINGS pRdpSettings, WCHAR lpKey[MAXKEY]; WCHAR lpValue[MAXVALUE]; INT NumSettings = 0; - INT s, structsize; + INT s; if (lpStr) { @@ -213,7 +212,7 @@ ParseSettings(PRDPSETTINGS pRdpSettings, for (s = 0; s < NumSettings; s++) { - INT i = 0, k, temp; + INT i = 0, k; /* get a key */ while (*lpStr != L':') @@ -271,7 +270,7 @@ ParseSettings(PRDPSETTINGS pRdpSettings, static LPWSTR ReadRdpFile(HANDLE hFile) { - LPWSTR lpBuffer; + LPWSTR lpBuffer = NULL; DWORD BytesToRead, BytesRead; BOOL bRes; @@ -313,7 +312,7 @@ ReadRdpFile(HANDLE hFile) static HANDLE OpenRdpFile(LPWSTR path, BOOL bWrite) { - HANDLE hFile; + HANDLE hFile = NULL; if (path) { @@ -389,7 +388,7 @@ SaveRdpSettingsToFile(LPWSTR lpFile, PRDPSETTINGS LoadRdpSettingsFromFile(LPWSTR lpFile) { - PRDPSETTINGS pRdpSettings; + PRDPSETTINGS pRdpSettings = NULL; WCHAR pszPath[MAX_PATH]; HANDLE hFile;