diff --git a/reactos/base/applications/mstsc/bitmap.c b/reactos/base/applications/mstsc/bitmap.c index 18e0cee757f..daf4bf2202a 100644 --- a/reactos/base/applications/mstsc/bitmap.c +++ b/reactos/base/applications/mstsc/bitmap.c @@ -28,7 +28,7 @@ /* indent is confused by this file */ /* *INDENT-OFF* */ -#include "rdesktop.h" +#include "todo.h" #define CVAL(p) (*(p++)) #ifdef NEED_ALIGN diff --git a/reactos/base/applications/mstsc/bsops.c b/reactos/base/applications/mstsc/bsops.c index 9a5aa64e482..15c7d065d28 100644 --- a/reactos/base/applications/mstsc/bsops.c +++ b/reactos/base/applications/mstsc/bsops.c @@ -18,23 +18,24 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include -#include -#include "bsops.h" +//#include +//#include +//#include "bsops.h" +#include "todo.h" /* globals */ static char * g_bs = 0; static int g_bs_size = 0; -static int g_width = 800; -static int g_height = 600; +static int g_width1 = 800; +static int g_height1 = 600; static int g_bpp = 8; static int g_Bpp = 1; -static int g_clip_left = 0; -static int g_clip_top = 0; -static int g_clip_right = 800; -static int g_clip_bottom = 600; +static int g_clip_left1 = 0; +static int g_clip_top1 = 0; +static int g_clip_right1 = 800; +static int g_clip_bottom1 = 600; /* for bs_patblt */ static unsigned char g_hatch_patterns[] = @@ -82,9 +83,9 @@ bs_get_pixel(int x, int y) { char * p; - if (x >= 0 && x < g_width && y >= 0 && y < g_height) + if (x >= 0 && x < g_width1 && y >= 0 && y < g_height1) { - p = g_bs + (y * g_width * g_Bpp) + (x * g_Bpp); + p = g_bs + (y * g_width1 * g_Bpp) + (x * g_Bpp); if (g_Bpp == 1) { return *((unsigned char *) p); @@ -112,12 +113,12 @@ bs_set_pixel(int x, int y, int pixel, int rop, int use_clip) char * p; if (!use_clip || - (x >= g_clip_left && x < g_clip_right && - y >= g_clip_top && y < g_clip_bottom)) + (x >= g_clip_left1 && x < g_clip_right1 && + y >= g_clip_top1 && y < g_clip_bottom1)) { - if (x >= 0 && x < g_width && y >= 0 && y < g_height) + if (x >= 0 && x < g_width1 && y >= 0 && y < g_height1) { - p = g_bs + (y * g_width * g_Bpp) + (x * g_Bpp); + p = g_bs + (y * g_width1 * g_Bpp) + (x * g_Bpp); if (rop != 12) { pixel = bs_do_rop(rop, pixel, bs_get_pixel(x, y)); @@ -144,9 +145,9 @@ get_bs_ptr(int x, int y) { char * p; - if (x >= 0 && x < g_width && y >= 0 && y < g_height) + if (x >= 0 && x < g_width1 && y >= 0 && y < g_height1) { - p = g_bs + (y * g_width * g_Bpp) + (x * g_Bpp); + p = g_bs + (y * g_width1 * g_Bpp) + (x * g_Bpp); return p; } else @@ -163,17 +164,17 @@ bs_init(int width, int height, int bpp) { free(g_bs); } - g_width = width; - g_height = height; + g_width1 = width; + g_height1 = height; g_bpp = bpp; g_Bpp = (bpp + 7) / 8; g_bs_size = width * height * g_Bpp; g_bs = malloc(g_bs_size); memset(g_bs, 0, g_bs_size); - g_clip_left = 0; - g_clip_top = 0; - g_clip_right = width; - g_clip_bottom = height; + g_clip_left1 = 0; + g_clip_top1 = 0; + g_clip_right1 = width; + g_clip_bottom1 = height; } /*****************************************************************************/ @@ -190,20 +191,20 @@ bs_exit(void) void bs_set_clip(int x, int y, int cx, int cy) { - g_clip_left = x; - g_clip_top = y; - g_clip_right = x + cx; - g_clip_bottom = y + cy; + g_clip_left1 = x; + g_clip_top1 = y; + g_clip_right1 = x + cx; + g_clip_bottom1 = y + cy; } /*****************************************************************************/ void bs_reset_clip(void) { - g_clip_left = 0; - g_clip_top = 0; - g_clip_right = g_width; - g_clip_bottom = g_height; + g_clip_left1 = 0; + g_clip_top1 = 0; + g_clip_right1 = g_width1; + g_clip_bottom1 = g_height1; } /*****************************************************************************/ @@ -326,29 +327,29 @@ bs_warp_coords(int * x, int * y, int * cx, int * cy, int dx; int dy; - if (g_clip_left > *x) + if (g_clip_left1 > *x) { - dx = g_clip_left - *x; + dx = g_clip_left1 - *x; } else { dx = 0; } - if (g_clip_top > *y) + if (g_clip_top1 > *y) { - dy = g_clip_top - *y; + dy = g_clip_top1 - *y; } else { dy = 0; } - if (*x + *cx > g_clip_right) + if (*x + *cx > g_clip_right1) { - *cx = (*cx - ((*x + *cx) - g_clip_right)); + *cx = (*cx - ((*x + *cx) - g_clip_right1)); } - if (*y + *cy > g_clip_bottom) + if (*y + *cy > g_clip_bottom1) { - *cy = (*cy - ((*y + *cy) - g_clip_bottom)); + *cy = (*cy - ((*y + *cy) - g_clip_bottom1)); } *cx = *cx - dx; *cy = *cy - dy; @@ -793,13 +794,13 @@ bs_copy_box(char * dst, int x, int y, int cx, int cy, int line_size) return; } /* nothing to draw, memset and leave */ - if (x + cx < 0 || y + cy < 0 || x >= g_width || y >= g_height) + if (x + cx < 0 || y + cy < 0 || x >= g_width1 || y >= g_height1) { memset(dst, 0, cx * cy * g_Bpp); return; } /* check if it goes over an edge */ - if (x < 0 || y < 0 || x + cx > g_width || y + cy > g_height) + if (x < 0 || y < 0 || x + cx > g_width1 || y + cy > g_height1) { memset(dst, 0, cx * cy * g_Bpp); if (x < 0) @@ -808,9 +809,9 @@ bs_copy_box(char * dst, int x, int y, int cx, int cy, int line_size) dst += -x * g_Bpp; x = 0; } - if (x + cx > g_width) + if (x + cx > g_width1) { - cx = g_width - x; + cx = g_width1 - x; } for (i = 0; i < cy; i++) { diff --git a/reactos/base/applications/mstsc/bsops.h b/reactos/base/applications/mstsc/bsops.h index c0c3112c1cb..7ee6f9a6c4e 100644 --- a/reactos/base/applications/mstsc/bsops.h +++ b/reactos/base/applications/mstsc/bsops.h @@ -18,6 +18,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#ifndef __BSOPS_MSTSC_H +#define __BSOPS_MSTSC_H + int bs_get_pixel(int x, int y); void bs_set_pixel(int x, int y, int pixel, int rop, int use_clip); int bs_do_rop(int rop, int src, int dst); @@ -47,3 +50,5 @@ void bs_patblt(int opcode, int x, int y, int cx, int cy, int brush_style, char * brush_pattern, int brush_x_org, int brush_y_org, int bgcolour, int fgcolour); + +#endif /* __BSOPS_MSTSC_H */ diff --git a/reactos/base/applications/mstsc/cache.c b/reactos/base/applications/mstsc/cache.c index 54636379325..287ee396263 100644 --- a/reactos/base/applications/mstsc/cache.c +++ b/reactos/base/applications/mstsc/cache.c @@ -19,7 +19,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "rdesktop.h" +#include "todo.h" /* BITMAP CACHE */ extern int g_pstcache_fd[]; diff --git a/reactos/base/applications/mstsc/channels.c b/reactos/base/applications/mstsc/channels.c index 389cce2e183..b36864e8ea3 100644 --- a/reactos/base/applications/mstsc/channels.c +++ b/reactos/base/applications/mstsc/channels.c @@ -19,7 +19,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "rdesktop.h" +#include "todo.h" #define MAX_CHANNELS 6 #define CHANNEL_CHUNK_LENGTH 1600 diff --git a/reactos/base/applications/mstsc/connectdialog.c b/reactos/base/applications/mstsc/connectdialog.c index 1c929f40540..30a4e5257b4 100644 --- a/reactos/base/applications/mstsc/connectdialog.c +++ b/reactos/base/applications/mstsc/connectdialog.c @@ -18,11 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include -#include -#include -#include -#include "resource.h" +#include "todo.h" #define MAX_KEY_NAME 255 @@ -72,6 +68,8 @@ typedef struct _INFO HWND hDisplayPage; HBITMAP hHeader; BITMAP headerbitmap; + HICON hMstscSm; + HICON hMstscLg; HICON hLogon; HICON hConn; HICON hRemote; @@ -541,11 +539,19 @@ OnResolutionChanged(PINFO pInfo, INT position) Pixel, sizeof(Pixel) / sizeof(WCHAR))) { +#ifdef _MSC_VER _swprintf(Buffer, Pixel, pInfo->DisplayDeviceList->Resolutions[position].dmPelsWidth, pInfo->DisplayDeviceList->Resolutions[position].dmPelsHeight, Pixel); +#else + swprintf(Buffer, + Pixel, + pInfo->DisplayDeviceList->Resolutions[position].dmPelsWidth, + pInfo->DisplayDeviceList->Resolutions[position].dmPelsHeight, + Pixel); +#endif } } @@ -678,11 +684,20 @@ FillResolutionsAndColors(PINFO pInfo) Pixel, sizeof(Pixel) / sizeof(WCHAR))) { +#ifdef _MSC_VER _swprintf(Buffer, Pixel, width, height, Pixel); +#else + swprintf(Buffer, + Pixel, + width, + height, + Pixel); +#endif + SendDlgItemMessageW(pInfo->hDisplayPage, IDC_SETTINGS_RESOLUTION_TEXT, WM_SETTEXT, @@ -918,6 +933,34 @@ OnMainCreate(HWND hwnd, /* add main settings pointer */ pInfo->pRdpSettings = pRdpSettings; + /* set the dialog icons */ + pInfo->hMstscSm = LoadImageW(hInst, + MAKEINTRESOURCEW(IDI_MSTSC), + IMAGE_ICON, + 16, + 16, + LR_DEFAULTCOLOR); + if (pInfo->hMstscSm) + { + SendMessageW(hwnd, + WM_SETICON, + ICON_SMALL, + (WPARAM)pInfo->hMstscSm); + } + pInfo->hMstscLg = LoadImageW(hInst, + MAKEINTRESOURCEW(IDI_MSTSC), + IMAGE_ICON, + 32, + 32, + LR_DEFAULTCOLOR); + if (pInfo->hMstscLg) + { + SendMessageW(hwnd, + WM_SETICON, + ICON_BIG, + (WPARAM)pInfo->hMstscLg); + } + pInfo->hHeader = (HBITMAP)LoadImageW(hInst, MAKEINTRESOURCEW(IDB_HEADER), IMAGE_BITMAP, @@ -940,10 +983,10 @@ OnMainCreate(HWND hwnd, (DLGPROC)GeneralDlgProc)) { WCHAR str[256]; - LoadStringW(hInst, IDS_TAB_GENERAL, str, 256); ZeroMemory(&item, sizeof(TCITEM)); item.mask = TCIF_TEXT; - item.pszText = str; + if (LoadStringW(hInst, IDS_TAB_GENERAL, str, 256)) + item.pszText = str; item.cchTextMax = 256; (void)TabCtrl_InsertItem(pInfo->hTab, 0, &item); } @@ -954,10 +997,10 @@ OnMainCreate(HWND hwnd, (DLGPROC)DisplayDlgProc)) { WCHAR str[256]; - LoadStringW(hInst, IDS_TAB_DISPLAY, str, 256); ZeroMemory(&item, sizeof(TCITEM)); item.mask = TCIF_TEXT; - item.pszText = str; + if (LoadStringW(hInst, IDS_TAB_DISPLAY, str, 256)) + item.pszText = str; item.cchTextMax = 256; (void)TabCtrl_InsertItem(pInfo->hTab, 1, &item); } @@ -1057,6 +1100,13 @@ DlgProc(HWND hDlg, { if (pInfo) { + if (pInfo->hMstscSm) + DestroyIcon(pInfo->hMstscSm); + if (pInfo->hMstscLg) + DestroyIcon(pInfo->hMstscLg); + if (pInfo->hHeader) + DeleteObject(pInfo->hHeader); + HeapFree(GetProcessHeap(), 0, pInfo); diff --git a/reactos/base/applications/mstsc/iso.c b/reactos/base/applications/mstsc/iso.c index 163946dffd7..1b4ced1ca82 100644 --- a/reactos/base/applications/mstsc/iso.c +++ b/reactos/base/applications/mstsc/iso.c @@ -18,7 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "rdesktop.h" +#include "todo.h" /* Send a self-contained ISO PDU */ static void diff --git a/reactos/base/applications/mstsc/licence.c b/reactos/base/applications/mstsc/licence.c index 09cb4548c6c..1012aac0a91 100644 --- a/reactos/base/applications/mstsc/licence.c +++ b/reactos/base/applications/mstsc/licence.c @@ -18,7 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "rdesktop.h" +#include "todo.h" //#include void * @@ -33,8 +33,8 @@ int ssl_mod_exp(char* out, int out_len, char* in, int in_len, char* mod, int mod_len, char* exp, int exp_len); -extern char g_username[64]; -extern char g_hostname[16]; +extern char g_username[]; +extern char g_hostname[]; static uint8 g_licence_key[16]; static uint8 g_licence_sign_key[16]; diff --git a/reactos/base/applications/mstsc/mcs.c b/reactos/base/applications/mstsc/mcs.c index c954d5e040a..d14a6fb6427 100644 --- a/reactos/base/applications/mstsc/mcs.c +++ b/reactos/base/applications/mstsc/mcs.c @@ -18,7 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "rdesktop.h" +#include "todo.h" uint16 g_mcs_userid; extern VCHANNEL g_channels[]; diff --git a/reactos/base/applications/mstsc/mppc.c b/reactos/base/applications/mstsc/mppc.c index cc126c1532a..9f12a919ee2 100644 --- a/reactos/base/applications/mstsc/mppc.c +++ b/reactos/base/applications/mstsc/mppc.c @@ -18,10 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include -#include - -#include "rdesktop.h" +#include "todo.h" /* mppc decompression */ /* http://www.faqs.org/rfcs/rfc2118.html */ diff --git a/reactos/base/applications/mstsc/mstsc.rbuild b/reactos/base/applications/mstsc/mstsc.rbuild index c32200f9944..041e3707c36 100644 --- a/reactos/base/applications/mstsc/mstsc.rbuild +++ b/reactos/base/applications/mstsc/mstsc.rbuild @@ -1,6 +1,6 @@ - + . 0x600 0x501 @@ -9,6 +9,9 @@ gdi32 comctl32 ws2_32 + advapi32 + shell32 + ole32 bitmap.c bsops.c @@ -23,6 +26,7 @@ pstcache.c rdp5.c rdp.c + rdpfile.c secure.c ssl_calls.c tcp.c diff --git a/reactos/base/applications/mstsc/orders.c b/reactos/base/applications/mstsc/orders.c index 9a83a99a0a6..f95e5387dc0 100644 --- a/reactos/base/applications/mstsc/orders.c +++ b/reactos/base/applications/mstsc/orders.c @@ -18,8 +18,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "rdesktop.h" -#include "orders.h" +#include "todo.h" + extern uint8 *g_next_packet; static RDP_ORDER_STATE g_order_state; diff --git a/reactos/base/applications/mstsc/orders.h b/reactos/base/applications/mstsc/orders.h index b127282251e..8f1202913f7 100644 --- a/reactos/base/applications/mstsc/orders.h +++ b/reactos/base/applications/mstsc/orders.h @@ -18,6 +18,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#ifndef __ORDERS_MSTSC_H +#define __ORDERS_MSTSC_H + #define RDP_ORDER_STANDARD 0x01 #define RDP_ORDER_SECONDARY 0x02 #define RDP_ORDER_BOUNDS 0x04 @@ -366,3 +369,5 @@ typedef struct _RDP_COLCACHE_ORDER } RDP_COLCACHE_ORDER; + +#endif /* __ORDERS_MSTSC_H */ diff --git a/reactos/base/applications/mstsc/pstcache.c b/reactos/base/applications/mstsc/pstcache.c index 9e6432bd6df..44596469465 100644 --- a/reactos/base/applications/mstsc/pstcache.c +++ b/reactos/base/applications/mstsc/pstcache.c @@ -18,7 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "rdesktop.h" +#include "todo.h" #define MAX_CELL_SIZE 0x1000 /* pixels */ diff --git a/reactos/base/applications/mstsc/rdesktop.h b/reactos/base/applications/mstsc/rdesktop.h index 0f39b6e3a9d..2e454e0dd7d 100644 --- a/reactos/base/applications/mstsc/rdesktop.h +++ b/reactos/base/applications/mstsc/rdesktop.h @@ -18,11 +18,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#ifndef __RDESKTOP_MSTSC_H +#define __RDESKTOP_MSTSC_H + #include #include #include #ifdef _WIN32 -#include /* winsock2.h first */ +//#include /* winsock2.h first */ #include #include #else /* WIN32 */ @@ -124,3 +127,5 @@ #ifndef MAKE_PROTO #include "proto.h" #endif + +#endif /* __RDESKTOP_MSTSC_H */ diff --git a/reactos/base/applications/mstsc/rdp.c b/reactos/base/applications/mstsc/rdp.c index 020e51de2d4..5363c7f4df6 100644 --- a/reactos/base/applications/mstsc/rdp.c +++ b/reactos/base/applications/mstsc/rdp.c @@ -18,26 +18,12 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -//#include -#ifndef _WIN32 -#include -#include -#endif -#include "rdesktop.h" +#include "todo.h" -#ifdef HAVE_ICONV -#ifdef HAVE_ICONV_H -#include -#endif - -#ifndef ICONV_CONST -#define ICONV_CONST "" -#endif -#endif extern uint16 g_mcs_userid; -extern char g_username[64]; -extern char g_codepage[16]; +extern char g_username[]; +extern char g_codepage[]; extern BOOL g_bitmap_compression; extern BOOL g_orders; extern BOOL g_encryption; diff --git a/reactos/base/applications/mstsc/rdp5.c b/reactos/base/applications/mstsc/rdp5.c index 78d9716842c..ab6596eff81 100644 --- a/reactos/base/applications/mstsc/rdp5.c +++ b/reactos/base/applications/mstsc/rdp5.c @@ -19,7 +19,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "rdesktop.h" +#include "todo.h" extern uint8 *g_next_packet; diff --git a/reactos/base/applications/mstsc/rdpfile.c b/reactos/base/applications/mstsc/rdpfile.c index 3314d98c3d4..499208a9c03 100644 --- a/reactos/base/applications/mstsc/rdpfile.c +++ b/reactos/base/applications/mstsc/rdpfile.c @@ -1,8 +1,5 @@ -#include -#include -#include -#include -#include "resource.h" + +#include "todo.h" #define NUM_SETTINGS 6 LPWSTR lpSettings[NUM_SETTINGS] = diff --git a/reactos/base/applications/mstsc/secure.c b/reactos/base/applications/mstsc/secure.c index 5dba480e7c5..8045baea45d 100644 --- a/reactos/base/applications/mstsc/secure.c +++ b/reactos/base/applications/mstsc/secure.c @@ -18,7 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "rdesktop.h" +#include "todo.h" //#include //#include @@ -62,7 +62,7 @@ int ssl_mod_exp(char* out, int out_len, char* in, int in_len, char* mod, int mod_len, char* exp, int exp_len); -extern char g_hostname[16]; +extern char g_hostname[]; extern int g_width; extern int g_height; extern unsigned int g_keylayout; diff --git a/reactos/base/applications/mstsc/ssl_calls.c b/reactos/base/applications/mstsc/ssl_calls.c index 376421850e1..554a1483fdf 100644 --- a/reactos/base/applications/mstsc/ssl_calls.c +++ b/reactos/base/applications/mstsc/ssl_calls.c @@ -20,7 +20,7 @@ */ -#include "rdesktop.h" +#include "todo.h" #define APP_CC diff --git a/reactos/base/applications/mstsc/tcp.c b/reactos/base/applications/mstsc/tcp.c index 597bacd1942..f9abc7fdf5d 100644 --- a/reactos/base/applications/mstsc/tcp.c +++ b/reactos/base/applications/mstsc/tcp.c @@ -18,18 +18,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef _WIN32 -#include /* select read write close */ -#include /* socket connect setsockopt */ -#include /* timeval */ -#include /* gethostbyname */ -#include /* sockaddr_in */ -#include /* TCP_NODELAY */ -#include /* inet_addr */ -#include /* errno */ -#endif /* _WIN32 */ -#include "rdesktop.h" +#include "todo.h" #ifdef _WIN32 #define socklen_t int diff --git a/reactos/base/applications/mstsc/todo.h b/reactos/base/applications/mstsc/todo.h index 14f07745a18..0af720cac7c 100644 --- a/reactos/base/applications/mstsc/todo.h +++ b/reactos/base/applications/mstsc/todo.h @@ -1,3 +1,19 @@ +#include +#include +#include +#include +#include "uimain.h" +#include "rdesktop.h" +#include "bsops.h" +#include "orders.h" +#include "resource.h" + +//#include + +#ifndef __TODO_MSTSC_H +#define __TODO_MSTSC_H + + #define MAXKEY 256 #define MAXVALUE 256 @@ -24,3 +40,6 @@ INT GetIntegerFromSettings(PRDPSETTINGS pSettings, LPWSTR lpValue); LPWSTR GetStringFromSettings(PRDPSETTINGS pSettings, LPWSTR lpValue); BOOL SetIntegerToSettings(PRDPSETTINGS pRdpSettings, LPWSTR lpKey, INT Value); BOOL SetStringToSettings(PRDPSETTINGS pRdpSettings, LPWSTR lpKey, LPWSTR lpValue); + + +#endif /* __TODO_MSTSC_H */ diff --git a/reactos/base/applications/mstsc/uimain.c b/reactos/base/applications/mstsc/uimain.c index d445514ed47..4bd6bcd03ca 100644 --- a/reactos/base/applications/mstsc/uimain.c +++ b/reactos/base/applications/mstsc/uimain.c @@ -18,8 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "rdesktop.h" -#include "bsops.h" +#include "todo.h" char g_username[256] = ""; char g_hostname[256] = ""; @@ -97,9 +96,12 @@ void mi_reset_clip(void); void mi_line(int x1, int y1, int x2, int y2, int colour); +void* mi_create_cursor(unsigned int x, unsigned int y, int width, int height, unsigned char * andmask, unsigned char * xormask); + + void mi_destroy_cursor(void * cursor); void diff --git a/reactos/base/applications/mstsc/uimain.h b/reactos/base/applications/mstsc/uimain.h index 7b979fe7215..593aa389b35 100644 --- a/reactos/base/applications/mstsc/uimain.h +++ b/reactos/base/applications/mstsc/uimain.h @@ -18,6 +18,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#ifndef __UIMAIN_MSTSC_H +#define __UIMAIN_MSTSC_H + /* in uimain.c */ int ui_main(void); @@ -74,3 +77,5 @@ ui_set_modifier_state(int code); #define UI_MAX(a, b) (((a) > (b)) ? (a) : (b)) #undef UI_MIN #define UI_MIN(a, b) (((a) < (b)) ? (a) : (b)) + +#endif /* __UIMAIN_MSTSC_H */ diff --git a/reactos/base/applications/mstsc/win32.c b/reactos/base/applications/mstsc/win32.c index 5aa1ef11fb1..cb6e9dec22d 100644 --- a/reactos/base/applications/mstsc/win32.c +++ b/reactos/base/applications/mstsc/win32.c @@ -19,12 +19,8 @@ */ #include /* winsock2.h first */ -#include -#include -#include -#include "uimain.h" #include "todo.h" -#include "resource.h" + extern char g_username[]; extern char g_hostname[]; @@ -999,7 +995,7 @@ mi_process_a_param(char * param1, int state) } else { - if (state == 1) /* -g */ + if (state == 1) /* -g widthxheight*/ { state = 0; if (strcmp(param1, "workarea") == 0) @@ -1022,12 +1018,12 @@ mi_process_a_param(char * param1, int state) } g_width_height_set = 1; } - if (state == 2) /* -t */ + if (state == 2) /* -t port */ { state = 0; g_tcp_port_rdp = atol(param1); } - if (state == 3) /* -a */ + if (state == 3) /* -a bpp */ { state = 0; g_server_depth = atol(param1); @@ -1036,32 +1032,32 @@ mi_process_a_param(char * param1, int state) mi_error("invalid server bpp\r\n"); } } - if (state == 5) /* -u */ + if (state == 5) /* -u username */ { state = 0; strcpy(g_username, param1); } - if (state == 6) /* -p */ + if (state == 6) /* -p password */ { state = 0; strcpy(g_password, param1); } - if (state == 7) /* -d */ + if (state == 7) /* -d domain */ { state = 0; strcpy(g_domain, param1); } - if (state == 8) /* -s */ + if (state == 8) /* -s shell */ { state = 0; strcpy(g_shell, param1); } - if (state == 9) /* -c */ + if (state == 9) /* -c workin directory*/ { state = 0; strcpy(g_directory, param1); } - if (state == 10) /* -n */ + if (state == 10) /* -n host name*/ { state = 0; strcpy(g_hostname, param1); @@ -1272,28 +1268,12 @@ mi_process_cl(LPTSTR lpCmdLine) return (state == 0); } -#ifdef WITH_DEBUG -/*****************************************************************************/ -int -main(int argc, char ** argv) -{ - WSADATA d; - WSAStartup(MAKEWORD(2, 0), &d); - if (!mi_process_cl(argv[0])) - { - mi_show_params(); - WSACleanup(); - return 0; - } - return ui_main(); -} -#else /* WITH_DEBUG */ /*****************************************************************************/ int WINAPI -WinMain(HINSTANCE hInstance, +wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, - LPTSTR lpCmdLine, + LPWSTR lpCmdLine, int nCmdShow) { PRDPSETTINGS pRdpSettings; @@ -1310,6 +1290,18 @@ WinMain(HINSTANCE hInstance, if (OpenRDPConnectDialog(hInstance, pRdpSettings)) { + strcpy(g_servername, "192.168.40.50"); + //g_port = 3389; + strcpy(g_username, "buildbot"); + strcpy(g_password, "P4ssw0rd"); + g_server_depth = 16; + g_width = 800; + g_height = 600; + g_screen_width = GetSystemMetrics(SM_CXSCREEN); + g_screen_height = GetSystemMetrics(SM_CYSCREEN); + g_xoff = GetSystemMetrics(SM_CXEDGE) * 2; + g_yoff = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYEDGE) * 2; + ui_main(); ret = 0; } @@ -1328,7 +1320,7 @@ WinMain(HINSTANCE hInstance, return ret; } -#endif /* WITH_DEBUG */ + /*****************************************************************************/ void