Author: gedmurphy Date: Thu Nov 8 15:47:25 2007 New Revision: 30269
URL: http://svn.reactos.org/svn/reactos?rev=30269&view=rev Log: fix the header mess and get it building with rosbe, albeit with many warnings at the moment
Modified: trunk/reactos/base/applications/mstsc/bitmap.c trunk/reactos/base/applications/mstsc/bsops.c trunk/reactos/base/applications/mstsc/bsops.h trunk/reactos/base/applications/mstsc/cache.c trunk/reactos/base/applications/mstsc/channels.c trunk/reactos/base/applications/mstsc/connectdialog.c trunk/reactos/base/applications/mstsc/iso.c trunk/reactos/base/applications/mstsc/licence.c trunk/reactos/base/applications/mstsc/mcs.c trunk/reactos/base/applications/mstsc/mppc.c trunk/reactos/base/applications/mstsc/mstsc.rbuild trunk/reactos/base/applications/mstsc/orders.c trunk/reactos/base/applications/mstsc/orders.h trunk/reactos/base/applications/mstsc/pstcache.c trunk/reactos/base/applications/mstsc/rdesktop.h trunk/reactos/base/applications/mstsc/rdp.c trunk/reactos/base/applications/mstsc/rdp5.c trunk/reactos/base/applications/mstsc/rdpfile.c trunk/reactos/base/applications/mstsc/secure.c trunk/reactos/base/applications/mstsc/ssl_calls.c trunk/reactos/base/applications/mstsc/tcp.c trunk/reactos/base/applications/mstsc/todo.h trunk/reactos/base/applications/mstsc/uimain.c trunk/reactos/base/applications/mstsc/uimain.h trunk/reactos/base/applications/mstsc/win32.c
Modified: trunk/reactos/base/applications/mstsc/bitmap.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/bit... ============================================================================== --- trunk/reactos/base/applications/mstsc/bitmap.c (original) +++ trunk/reactos/base/applications/mstsc/bitmap.c Thu Nov 8 15:47:25 2007 @@ -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
Modified: trunk/reactos/base/applications/mstsc/bsops.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/bso... ============================================================================== --- trunk/reactos/base/applications/mstsc/bsops.c (original) +++ trunk/reactos/base/applications/mstsc/bsops.c Thu Nov 8 15:47:25 2007 @@ -18,23 +18,24 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include <stdlib.h> -#include <string.h> -#include "bsops.h" +//#include <stdlib.h> +//#include <string.h> +//#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 @@ { char * p;
- if (x >= 0 && x < g_width && y >= 0 && y < g_height) - { - p = g_bs + (y * g_width * g_Bpp) + (x * g_Bpp); + if (x >= 0 && x < g_width1 && y >= 0 && y < g_height1) + { + p = g_bs + (y * g_width1 * g_Bpp) + (x * g_Bpp); if (g_Bpp == 1) { return *((unsigned char *) p); @@ -112,12 +113,12 @@ char * p;
if (!use_clip || - (x >= g_clip_left && x < g_clip_right && - y >= g_clip_top && y < g_clip_bottom)) - { - if (x >= 0 && x < g_width && y >= 0 && y < g_height) - { - p = g_bs + (y * g_width * g_Bpp) + (x * g_Bpp); + (x >= g_clip_left1 && x < g_clip_right1 && + y >= g_clip_top1 && y < g_clip_bottom1)) + { + if (x >= 0 && x < g_width1 && y >= 0 && y < g_height1) + { + 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 @@ { char * p;
- if (x >= 0 && x < g_width && y >= 0 && y < g_height) - { - p = g_bs + (y * g_width * g_Bpp) + (x * g_Bpp); + if (x >= 0 && x < g_width1 && y >= 0 && y < g_height1) + { + p = g_bs + (y * g_width1 * g_Bpp) + (x * g_Bpp); return p; } else @@ -163,17 +164,17 @@ { 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 @@ 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 @@ int dx; int dy;
- if (g_clip_left > *x) - { - dx = g_clip_left - *x; + if (g_clip_left1 > *x) + { + dx = g_clip_left1 - *x; } else { dx = 0; } - if (g_clip_top > *y) - { - dy = g_clip_top - *y; + if (g_clip_top1 > *y) + { + dy = g_clip_top1 - *y; } else { dy = 0; } - if (*x + *cx > g_clip_right) - { - *cx = (*cx - ((*x + *cx) - g_clip_right)); - } - if (*y + *cy > g_clip_bottom) - { - *cy = (*cy - ((*y + *cy) - g_clip_bottom)); + if (*x + *cx > g_clip_right1) + { + *cx = (*cx - ((*x + *cx) - g_clip_right1)); + } + if (*y + *cy > g_clip_bottom1) + { + *cy = (*cy - ((*y + *cy) - g_clip_bottom1)); } *cx = *cx - dx; *cy = *cy - dy; @@ -793,13 +794,13 @@ 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 @@ dst += -x * g_Bpp; x = 0; } - if (x + cx > g_width) - { - cx = g_width - x; + if (x + cx > g_width1) + { + cx = g_width1 - x; } for (i = 0; i < cy; i++) {
Modified: trunk/reactos/base/applications/mstsc/bsops.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/bso... ============================================================================== --- trunk/reactos/base/applications/mstsc/bsops.h (original) +++ trunk/reactos/base/applications/mstsc/bsops.h Thu Nov 8 15:47:25 2007 @@ -17,6 +17,9 @@ along with this program; if not, write to the Free Software 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); @@ -47,3 +50,5 @@ int brush_style, char * brush_pattern, int brush_x_org, int brush_y_org, int bgcolour, int fgcolour); + +#endif /* __BSOPS_MSTSC_H */
Modified: trunk/reactos/base/applications/mstsc/cache.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/cac... ============================================================================== --- trunk/reactos/base/applications/mstsc/cache.c (original) +++ trunk/reactos/base/applications/mstsc/cache.c Thu Nov 8 15:47:25 2007 @@ -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[];
Modified: trunk/reactos/base/applications/mstsc/channels.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/cha... ============================================================================== --- trunk/reactos/base/applications/mstsc/channels.c (original) +++ trunk/reactos/base/applications/mstsc/channels.c Thu Nov 8 15:47:25 2007 @@ -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
Modified: trunk/reactos/base/applications/mstsc/connectdialog.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/con... ============================================================================== --- trunk/reactos/base/applications/mstsc/connectdialog.c (original) +++ trunk/reactos/base/applications/mstsc/connectdialog.c Thu Nov 8 15:47:25 2007 @@ -18,11 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include <windows.h> -#include <commctrl.h> -#include <stdio.h> -#include <todo.h> -#include "resource.h" +#include "todo.h"
#define MAX_KEY_NAME 255 @@ -72,6 +68,8 @@ HWND hDisplayPage; HBITMAP hHeader; BITMAP headerbitmap; + HICON hMstscSm; + HICON hMstscLg; HICON hLogon; HICON hConn; HICON hRemote; @@ -541,11 +539,19 @@ 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 @@ 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 @@ /* 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 @@ (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 @@ (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 @@ { if (pInfo) { + if (pInfo->hMstscSm) + DestroyIcon(pInfo->hMstscSm); + if (pInfo->hMstscLg) + DestroyIcon(pInfo->hMstscLg); + if (pInfo->hHeader) + DeleteObject(pInfo->hHeader); + HeapFree(GetProcessHeap(), 0, pInfo);
Modified: trunk/reactos/base/applications/mstsc/iso.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/iso... ============================================================================== --- trunk/reactos/base/applications/mstsc/iso.c (original) +++ trunk/reactos/base/applications/mstsc/iso.c Thu Nov 8 15:47:25 2007 @@ -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
Modified: trunk/reactos/base/applications/mstsc/licence.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/lic... ============================================================================== --- trunk/reactos/base/applications/mstsc/licence.c (original) +++ trunk/reactos/base/applications/mstsc/licence.c Thu Nov 8 15:47:25 2007 @@ -18,7 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include "rdesktop.h" +#include "todo.h" //#include <openssl/rc4.h>
void * @@ -33,8 +33,8 @@ 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];
Modified: trunk/reactos/base/applications/mstsc/mcs.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/mcs... ============================================================================== --- trunk/reactos/base/applications/mstsc/mcs.c (original) +++ trunk/reactos/base/applications/mstsc/mcs.c Thu Nov 8 15:47:25 2007 @@ -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[];
Modified: trunk/reactos/base/applications/mstsc/mppc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/mpp... ============================================================================== --- trunk/reactos/base/applications/mstsc/mppc.c (original) +++ trunk/reactos/base/applications/mstsc/mppc.c Thu Nov 8 15:47:25 2007 @@ -18,10 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include <stdio.h> -#include <string.h> - -#include "rdesktop.h" +#include "todo.h"
/* mppc decompression */ /* http://www.faqs.org/rfcs/rfc2118.html */
Modified: trunk/reactos/base/applications/mstsc/mstsc.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/mst... ============================================================================== --- trunk/reactos/base/applications/mstsc/mstsc.rbuild (original) +++ trunk/reactos/base/applications/mstsc/mstsc.rbuild Thu Nov 8 15:47:25 2007 @@ -1,6 +1,6 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd"> -<module name="mstsc" type="win32gui" installbase="system32" installname="mstsc.exe" unicode="no"> +<module name="mstsc" type="win32gui" installbase="system32" installname="mstsc.exe" unicode="yes" allowwarnings="true"> <include base="mstsc">.</include> <define name="_WIN32_IE">0x600</define> <define name="_WIN32_WINNT">0x501</define> @@ -9,6 +9,9 @@ <library>gdi32</library> <library>comctl32</library> <library>ws2_32</library> + <library>advapi32</library> + <library>shell32</library> + <library>ole32</library> <compilationunit name="unit.c"> <file>bitmap.c</file> <file>bsops.c</file> @@ -23,6 +26,7 @@ <file>pstcache.c</file> <file>rdp5.c</file> <file>rdp.c</file> + <file>rdpfile.c</file> <file>secure.c</file> <file>ssl_calls.c</file> <file>tcp.c</file>
Modified: trunk/reactos/base/applications/mstsc/orders.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/ord... ============================================================================== --- trunk/reactos/base/applications/mstsc/orders.c (original) +++ trunk/reactos/base/applications/mstsc/orders.c Thu Nov 8 15:47:25 2007 @@ -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;
Modified: trunk/reactos/base/applications/mstsc/orders.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/ord... ============================================================================== --- trunk/reactos/base/applications/mstsc/orders.h (original) +++ trunk/reactos/base/applications/mstsc/orders.h Thu Nov 8 15:47:25 2007 @@ -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 @@
} RDP_COLCACHE_ORDER; + +#endif /* __ORDERS_MSTSC_H */
Modified: trunk/reactos/base/applications/mstsc/pstcache.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/pst... ============================================================================== --- trunk/reactos/base/applications/mstsc/pstcache.c (original) +++ trunk/reactos/base/applications/mstsc/pstcache.c Thu Nov 8 15:47:25 2007 @@ -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 */
Modified: trunk/reactos/base/applications/mstsc/rdesktop.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/rde... ============================================================================== --- trunk/reactos/base/applications/mstsc/rdesktop.h (original) +++ trunk/reactos/base/applications/mstsc/rdesktop.h Thu Nov 8 15:47:25 2007 @@ -18,11 +18,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+#ifndef __RDESKTOP_MSTSC_H +#define __RDESKTOP_MSTSC_H + #include <stdlib.h> #include <stdio.h> #include <string.h> #ifdef _WIN32 -#include <winsock2.h> /* winsock2.h first */ +//#include <winsock2.h> /* winsock2.h first */ #include <windows.h> #include <time.h> #else /* WIN32 */ @@ -124,3 +127,5 @@ #ifndef MAKE_PROTO #include "proto.h" #endif + +#endif /* __RDESKTOP_MSTSC_H */
Modified: trunk/reactos/base/applications/mstsc/rdp.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/rdp... ============================================================================== --- trunk/reactos/base/applications/mstsc/rdp.c (original) +++ trunk/reactos/base/applications/mstsc/rdp.c Thu Nov 8 15:47:25 2007 @@ -18,26 +18,12 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-//#include <time.h> -#ifndef _WIN32 -#include <errno.h> -#include <unistd.h> -#endif -#include "rdesktop.h" - -#ifdef HAVE_ICONV -#ifdef HAVE_ICONV_H -#include <iconv.h> -#endif - -#ifndef ICONV_CONST -#define ICONV_CONST "" -#endif -#endif +#include "todo.h" +
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;
Modified: trunk/reactos/base/applications/mstsc/rdp5.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/rdp... ============================================================================== --- trunk/reactos/base/applications/mstsc/rdp5.c (original) +++ trunk/reactos/base/applications/mstsc/rdp5.c Thu Nov 8 15:47:25 2007 @@ -19,7 +19,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include "rdesktop.h" +#include "todo.h"
extern uint8 *g_next_packet;
Modified: trunk/reactos/base/applications/mstsc/rdpfile.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/rdp... ============================================================================== --- trunk/reactos/base/applications/mstsc/rdpfile.c (original) +++ trunk/reactos/base/applications/mstsc/rdpfile.c Thu Nov 8 15:47:25 2007 @@ -1,8 +1,5 @@ -#include <windows.h> -#include <stdio.h> -#include <shlobj.h> -#include <todo.h> -#include "resource.h" + +#include "todo.h"
#define NUM_SETTINGS 6 LPWSTR lpSettings[NUM_SETTINGS] =
Modified: trunk/reactos/base/applications/mstsc/secure.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/sec... ============================================================================== --- trunk/reactos/base/applications/mstsc/secure.c (original) +++ trunk/reactos/base/applications/mstsc/secure.c Thu Nov 8 15:47:25 2007 @@ -18,7 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include "rdesktop.h" +#include "todo.h"
//#include <openssl/rc4.h> //#include <openssl/md5.h> @@ -62,7 +62,7 @@ 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;
Modified: trunk/reactos/base/applications/mstsc/ssl_calls.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/ssl... ============================================================================== --- trunk/reactos/base/applications/mstsc/ssl_calls.c (original) +++ trunk/reactos/base/applications/mstsc/ssl_calls.c Thu Nov 8 15:47:25 2007 @@ -20,7 +20,7 @@
*/
-#include "rdesktop.h" +#include "todo.h"
#define APP_CC
Modified: trunk/reactos/base/applications/mstsc/tcp.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/tcp... ============================================================================== --- trunk/reactos/base/applications/mstsc/tcp.c (original) +++ trunk/reactos/base/applications/mstsc/tcp.c Thu Nov 8 15:47:25 2007 @@ -18,18 +18,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#ifndef _WIN32 -#include <unistd.h> /* select read write close */ -#include <sys/socket.h> /* socket connect setsockopt */ -#include <sys/time.h> /* timeval */ -#include <netdb.h> /* gethostbyname */ -#include <netinet/in.h> /* sockaddr_in */ -#include <netinet/tcp.h> /* TCP_NODELAY */ -#include <arpa/inet.h> /* inet_addr */ -#include <errno.h> /* errno */ -#endif /* _WIN32 */ - -#include "rdesktop.h" + +#include "todo.h"
#ifdef _WIN32 #define socklen_t int
Modified: trunk/reactos/base/applications/mstsc/todo.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/tod... ============================================================================== --- trunk/reactos/base/applications/mstsc/todo.h (original) +++ trunk/reactos/base/applications/mstsc/todo.h Thu Nov 8 15:47:25 2007 @@ -1,3 +1,19 @@ +#include <windows.h> +#include <commctrl.h> +#include <shlobj.h> +#include <stdio.h> +#include "uimain.h" +#include "rdesktop.h" +#include "bsops.h" +#include "orders.h" +#include "resource.h" + +//#include <stdio.h> + +#ifndef __TODO_MSTSC_H +#define __TODO_MSTSC_H + + #define MAXKEY 256 #define MAXVALUE 256
@@ -24,3 +40,6 @@ 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 */
Modified: trunk/reactos/base/applications/mstsc/uimain.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/uim... ============================================================================== --- trunk/reactos/base/applications/mstsc/uimain.c (original) +++ trunk/reactos/base/applications/mstsc/uimain.c Thu Nov 8 15:47:25 2007 @@ -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 @@ 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
Modified: trunk/reactos/base/applications/mstsc/uimain.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/uim... ============================================================================== --- trunk/reactos/base/applications/mstsc/uimain.h (original) +++ trunk/reactos/base/applications/mstsc/uimain.h Thu Nov 8 15:47:25 2007 @@ -17,6 +17,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifndef __UIMAIN_MSTSC_H +#define __UIMAIN_MSTSC_H
/* in uimain.c */ int @@ -74,3 +77,5 @@ #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 */
Modified: trunk/reactos/base/applications/mstsc/win32.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/win... ============================================================================== --- trunk/reactos/base/applications/mstsc/win32.c (original) +++ trunk/reactos/base/applications/mstsc/win32.c Thu Nov 8 15:47:25 2007 @@ -19,12 +19,8 @@ */
#include <winsock2.h> /* winsock2.h first */ -#include <windows.h> -#include <winuser.h> -#include <stdio.h> -#include "uimain.h" #include "todo.h" -#include "resource.h" +
extern char g_username[]; extern char g_hostname[]; @@ -999,7 +995,7 @@ } else { - if (state == 1) /* -g */ + if (state == 1) /* -g widthxheight*/ { state = 0; if (strcmp(param1, "workarea") == 0) @@ -1022,12 +1018,12 @@ } 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_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 @@ 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 @@ 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 @@
return ret; } -#endif /* WITH_DEBUG */ +
/*****************************************************************************/ void