/[rdesktop]/sourceforge.net/trunk/seamlessrdp/ServerExe/HookDll/hookdll.cpp
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/seamlessrdp/ServerExe/HookDll/hookdll.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 993 by astrand, Sun Aug 28 12:58:39 2005 UTC revision 995 by astrand, Mon Aug 29 09:10:13 2005 UTC
# Line 5  Line 5 
5  #include "hookdll.h"  #include "hookdll.h"
6  #include <windows.h>  #include <windows.h>
7  #include <winuser.h>  #include <winuser.h>
8    #include <stdio.h>
9    
10  #include "wtsapi32.h"  #include "wtsapi32.h"
11  #include "Cchannel.h"  #include "Cchannel.h"
# Line 25  HWND hWnd = 0; Line 26  HWND hWnd = 0;
26  bool bHooked = false;  bool bHooked = false;
27  bool bHooked2 = false;  bool bHooked2 = false;
28  bool bHooked3 = false;  bool bHooked3 = false;
29  HHOOK hhook = 0;                //cbt  HHOOK hhook = 0; //cbt
30  HHOOK hhook2 = 0;               //shell  HHOOK hhook2 = 0; //shell
31  HHOOK hhook3 = 0;               //wnd proc  HHOOK hhook3 = 0; //wnd proc
32  HINSTANCE hInst = 0;  HINSTANCE hInst = 0;
33  HANDLE m_vcHandle = 0;  HANDLE m_vcHandle = 0;
34    
35  BOOL APIENTRY DllMain( HINSTANCE hinstDLL, DWORD ul_reason_for_call,  BOOL APIENTRY DllMain( HINSTANCE hinstDLL, DWORD ul_reason_for_call, LPVOID lpReserved )
                        LPVOID lpReserved )  
36  {  {
37      switch ( ul_reason_for_call ) {      switch ( ul_reason_for_call ) {
38          case DLL_PROCESS_ATTACH: {          case DLL_PROCESS_ATTACH: {
# Line 67  LRESULT CALLBACK CallWndProc( int nCode, Line 67  LRESULT CALLBACK CallWndProc( int nCode,
67      char windowTitle[ 150 ] = { ""      char windowTitle[ 150 ] = { ""
68                                };                                };
69      HWND windowHandle = NULL;      HWND windowHandle = NULL;
70        HWND windowHandle2 = NULL;
71      char result[ 255 ] = { ""      char result[ 255 ] = { ""
72                           };                           };
73      char strWindowId[ 25 ];      char strWindowId[ 25 ];
74      char type[ 25 ];      char type[ 25 ];
75            
76      LONG b, t, l, r;      LONG b, t, l, r;
77      char strB[ 5 ];      char strX[ 5 ];
78      char strT[ 5 ];      char strY[ 5 ];
79      char strL[ 5 ];      char strW[ 5 ];
80      char strR[ 5 ];      char strH[ 5 ];
81      RECT rect;      RECT rect;
82            
83      CWPSTRUCT *details = ( CWPSTRUCT * ) lParam;      CWPSTRUCT *details = ( CWPSTRUCT * ) lParam;
84        CREATESTRUCT *cs = ( CREATESTRUCT * ) details->lParam;
85        LONG dwStyle = GetWindowLong( details->hwnd, GWL_STYLE );
86            
87      switch ( details->message ) {      switch ( details->message ) {
88          case WM_SIZING:          case WM_SIZING:
89            windowHandle = details->hwnd;
90            //get win name
91            GetWindowText( windowHandle, windowTitle, 150 );
92            
93            //get an id for it
94            itoa( ( int ) windowHandle, strWindowId, 10 );
95            
96            //get coords
97            GetWindowRect( windowHandle, &rect );
98            b = rect.bottom;
99            t = rect.top;
100            l = rect.left;
101            r = rect.right;
102            ltoa( b - t, strH, 10 );
103            ltoa( t, strY, 10 );
104            ltoa( r - l, strW, 10 );
105            ltoa( l, strX, 10 );
106            
107            ////setup return string
108            strcat( result, "MSG=CALLWNDPROC_WM_SIZING;OP=6;" );
109            strcat( result, "ID=" );
110            strcat( result, strWindowId );
111            strcat( result, ";" );
112            strcat( result, "TITLE=" );
113            strcat( result, windowTitle );
114            strcat( result, ";" );
115            strcat( result, "X=" );
116            strcat( result, strX );
117            strcat( result, ";" );
118            strcat( result, "Y=" );
119            strcat( result, strY );
120            strcat( result, ";" );
121            strcat( result, "H=" );
122            strcat( result, strH );
123            strcat( result, ";" );
124            strcat( result, "W=" );
125            strcat( result, strW );
126            strcat( result, "." );
127            
128            buffer = result;
129            
130            break;
131          case WM_MOVING:          case WM_MOVING:
132                    
133          windowHandle = details->hwnd;          windowHandle = details->hwnd;
# Line 98  LRESULT CALLBACK CallWndProc( int nCode, Line 143  LRESULT CALLBACK CallWndProc( int nCode,
143          t = rect.top;          t = rect.top;
144          l = rect.left;          l = rect.left;
145          r = rect.right;          r = rect.right;
146          ltoa( b, strB, 10 );          ltoa( b - t, strH, 10 );
147          ltoa( t, strT, 10 );          ltoa( t, strY, 10 );
148          ltoa( r, strR, 10 );          ltoa( r - l, strW, 10 );
149          ltoa( l, strL, 10 );          ltoa( l, strX, 10 );
150            
151            ////setup return string
152            strcat( result, "MSG=CALLWNDPROC_WM_MOVING;OP=2;" );
153            strcat( result, "ID=" );
154            strcat( result, strWindowId );
155            strcat( result, ";" );
156            strcat( result, "TITLE=" );
157            strcat( result, windowTitle );
158            strcat( result, ";" );
159            strcat( result, "X=" );
160            strcat( result, strX );
161            strcat( result, ";" );
162            strcat( result, "Y=" );
163            strcat( result, strY );
164            strcat( result, ";" );
165            strcat( result, "H=" );
166            strcat( result, strH );
167            strcat( result, ";" );
168            strcat( result, "W=" );
169            strcat( result, strW );
170            strcat( result, "." );
171            
172            buffer = result;
173            
174            break;
175            
176            
177            case WM_WINDOWPOSCHANGING:
178            
179            windowHandle = details->hwnd;
180            //windowHandle2 = details->hwndInsertAfter;
181            //get win name
182            GetWindowText( windowHandle, windowTitle, 150 );
183            
184            //get an id for it
185            itoa( ( int ) windowHandle, strWindowId, 10 );
186            
187            //get coords
188            GetWindowRect( windowHandle, &rect );
189            b = rect.bottom;
190            t = rect.top;
191            l = rect.left;
192            r = rect.right;
193            ltoa( b - t, strH, 10 );
194            ltoa( t, strY, 10 );
195            ltoa( r - l, strW, 10 );
196            ltoa( l, strX, 10 );
197                    
198          ////setup return string          ////setup return string
199          strcat( result, "MSG=CALLWNDPROC_WM_MOVING;" );          strcat( result, "MSG=CALLWNDPROC_WM_WINDOWPOSCHANGING;OP=7;" );
200          strcat( result, "ID=" );          strcat( result, "ID=" );
201          strcat( result, strWindowId );          strcat( result, strWindowId );
202          strcat( result, ";" );          strcat( result, ";" );
203          strcat( result, "TITLE=" );          strcat( result, "TITLE=" );
204          strcat( result, windowTitle );          strcat( result, windowTitle );
205          strcat( result, ";" );          strcat( result, ";" );
206          strcat( result, "POS=" );          strcat( result, "X=" );
207          strcat( result, strL );          strcat( result, strX );
208          strcat( result, "~" );          strcat( result, ";" );
209          strcat( result, strT );          strcat( result, "Y=" );
210          strcat( result, "~" );          strcat( result, strY );
         strcat( result, strR );  
         strcat( result, "~" );  
         strcat( result, strB );  
211          strcat( result, ";" );          strcat( result, ";" );
212            strcat( result, "H=" );
213            strcat( result, strH );
214            strcat( result, ";" );
215            strcat( result, "W=" );
216            strcat( result, strW );
217            strcat( result, "." );
218                    
219          buffer = result;          buffer = result;
220                    
221          break;          break;
222            case WM_WINDOWPOSCHANGED:
223            
224            windowHandle = details->hwnd;
225            //windowHandle2 = details->hwndInsertAfter;
226            //get win name
227            GetWindowText( windowHandle, windowTitle, 150 );
228            
229            //get an id for it
230            itoa( ( int ) windowHandle, strWindowId, 10 );
231            
232            //get coords
233            GetWindowRect( windowHandle, &rect );
234            b = rect.bottom;
235            t = rect.top;
236            l = rect.left;
237            r = rect.right;
238            ltoa( b - t, strH, 10 );
239            ltoa( t, strY, 10 );
240            ltoa( r - l, strW, 10 );
241            ltoa( l, strX, 10 );
242            
243            ////setup return string
244            strcat( result, "MSG=CALLWNDPROC_WM_WINDOWPOSCHANGED;OP=8;" );
245            strcat( result, "ID=" );
246            strcat( result, strWindowId );
247            strcat( result, ";" );
248            strcat( result, "TITLE=" );
249            strcat( result, windowTitle );
250            strcat( result, ";" );
251            strcat( result, "X=" );
252            strcat( result, strX );
253            strcat( result, ";" );
254            strcat( result, "Y=" );
255            strcat( result, strY );
256            strcat( result, ";" );
257            strcat( result, "H=" );
258            strcat( result, strH );
259            strcat( result, ";" );
260            strcat( result, "W=" );
261            strcat( result, strW );
262            strcat( result, "." );
263            
264            buffer = result;
265            
266            break;
267            
268            
269            case WM_CREATE:
270            if ( cs->style & WS_DLGFRAME ) {
271                sprintf( result, "DEBUG:WM_CREATE:%dx%d at %d,%d, title=%s, menu=%p, window=%p, WS_BORDER=%d, WS_DLGFRAME=%d, WS_POPUP=%d",
272                         cs->cx, cs->cy, cs->x, cs->y, cs->lpszName, cs->hMenu, details->hwnd,
273                         cs->style & WS_BORDER, cs->style & WS_DLGFRAME,
274                         cs->style & WS_POPUP );
275                buffer = result;
276            }
277            
278            break;
279            
280            
281            case WM_DESTROY:
282            if ( dwStyle & WS_DLGFRAME ) {
283                sprintf( result, "WM_DESTROY:%p", details->hwnd );
284                buffer = result;
285            }
286            
287            break;
288                    
289          default:          default:
290          break;          break;
# Line 158  LRESULT CALLBACK CbtProc( int nCode, WPA Line 319  LRESULT CALLBACK CbtProc( int nCode, WPA
319            
320            
321      LONG b, t, l, r;      LONG b, t, l, r;
322      char strB[ 5 ];      char strW[ 5 ];
323      char strT[ 5 ];      char strY[ 5 ];
324      char strL[ 5 ];      char strX[ 5 ];
325      char strR[ 5 ];      char strH[ 5 ];
326      RECT rect;      RECT rect;
327            
328      int i = 0;                  //tmp      int i = 0; //tmp
329            
330      switch ( nCode ) {      switch ( nCode ) {
331          case HCBT_MINMAX:          case HCBT_MINMAX:
# Line 191  LRESULT CALLBACK CbtProc( int nCode, WPA Line 352  LRESULT CALLBACK CbtProc( int nCode, WPA
352          t = rect.top;          t = rect.top;
353          l = rect.left;          l = rect.left;
354          r = rect.right;          r = rect.right;
355          ltoa( b, strB, 10 );          ltoa( b - t, strW, 10 );
356          ltoa( t, strT, 10 );          ltoa( t, strY, 10 );
357          ltoa( r, strR, 10 );          ltoa( r - l, strH, 10 );
358          ltoa( l, strL, 10 );          ltoa( l, strX, 10 );
359                    
360          //get name          //get name
361          GetWindowText( windowHandle, windowTitle, 150 );          GetWindowText( windowHandle, windowTitle, 150 );
362                    
363          ////setup return string          ////setup return string
364          strcat( result, "MSG=HCBT_MINMAX;" );          strcat( result, "MSG=HCBT_MINMAX;OP=4;" );
365            
366            // SW_SHOWNOACTIVATE=4  SW_SHOW=5  SW_MINIMIZE=6  SW_SHOWMINNOACTIVE=7  SW_SHOWNA=8  SW_RESTORE=9
367            // SW_SHOWDEFAULT=10  SW_FORCEMINIMIZE=11  SW_MAX=11
368          strcat( result, "ID=" );          strcat( result, "ID=" );
369          strcat( result, strWindowId );          strcat( result, strWindowId );
370          strcat( result, ";" );          strcat( result, ";" );
371          strcat( result, "TITLE=" );          strcat( result, "TITLE=" );
372          strcat( result, windowTitle );          strcat( result, windowTitle );
373          strcat( result, ";" );          strcat( result, ";" );
374          strcat( result, "POS=" );          strcat( result, "X=" );
375          strcat( result, strL );          strcat( result, strX );
376          strcat( result, "~" );          strcat( result, ";" );
377          strcat( result, strT );          strcat( result, "Y=" );
378          strcat( result, "~" );          strcat( result, strY );
379          strcat( result, strR );          strcat( result, ";" );
380          strcat( result, "~" );          strcat( result, "H=" );
381          strcat( result, strB );          strcat( result, strH );
382            strcat( result, ";" );
383            strcat( result, "W=" );
384            strcat( result, strW );
385          strcat( result, ";" );          strcat( result, ";" );
386          strcat( result, "TYPE=" );          strcat( result, "TYPE=" );
387          strcat( result, type );          strcat( result, type );
388          strcat( result, ";" );          strcat( result, "." );
389                    
390          //-------------------------------------------------------------------------------------------------          //-------------------------------------------------------------------------------------------------
391          // code to prevent minimising windows (can be removed once minimise has been implemented)          // code to prevent minimising windows (can be removed once minimise has been implemented)
392          i = ( int ) lParam;          //i = (int)lParam;
393          //if (i==0 || i==2 || i==6 || i==7 || i==8 || i==11)          //if (i==0 || i==2 || i==6 || i==7 || i==8 || i==11)
394          if ( i == 2 || i == 6 ) {          //if ( i==2 || i==6 )
395              MessageBox( 0,          //{
396                          "Minimising windows is not allowed in this version. Sorry!",          // MessageBox(0,"Minimising windows is not allowed in this version. Sorry!","TS Window Clipper", MB_OK);
397                          "TS Window Clipper", MB_OK );          // return 1;
398              return 1;          //}
         }  
399          //-----------------------------------------------------------------------------------------          //-----------------------------------------------------------------------------------------
400                    
401          //-------------------------------------------------------------------------------------------------          //-------------------------------------------------------------------------------------------------
402          // code to prevent maximising windows (can be removed once maximise has been implemented)          // code to prevent maximising windows (can be removed once maximise has been implemented)
403          i = ( int ) lParam;          //i = (int)lParam;
404          //if (i==3 || i==9 || i==11)          //if (i==3 || i==9 || i==11)
405          if ( i == 3 || i == 11 ) {          //if (i==3 || i==11)
406              MessageBox( 0,          //{
407                          "Maximising windows is not allowed in this version. Sorry!",          // MessageBox(0,"Maximising windows is not allowed in this version. Sorry!","TS Window Clipper", MB_OK);
408                          "TS Window Clipper", MB_OK );          // return 1;
409              return 1;          //}
         }  
410          //-----------------------------------------------------------------------------------------          //-----------------------------------------------------------------------------------------
411                    
412          buffer = result;          buffer = result;
# Line 263  LRESULT CALLBACK CbtProc( int nCode, WPA Line 428  LRESULT CALLBACK CbtProc( int nCode, WPA
428          t = rect.top;          t = rect.top;
429          l = rect.left;          l = rect.left;
430          r = rect.right;          r = rect.right;
431          ltoa( b, strB, 10 );          ltoa( b - t, strH, 10 );
432          ltoa( t, strT, 10 );          ltoa( t, strY, 10 );
433          ltoa( r, strR, 10 );          ltoa( r - l, strW, 10 );
434          ltoa( l, strL, 10 );          ltoa( l, strX, 10 );
435                    
436          //get name          //get name
437          GetWindowText( windowHandle, windowTitle, 150 );          GetWindowText( windowHandle, windowTitle, 150 );
438                    
439          ////setup return string          ////setup return string
440          strcat( result, "MSG=HCBT_MOVESIZE;" );          strcat( result, "MSG=HCBT_MOVESIZE;OP=5;" );
441          strcat( result, "ID=" );          strcat( result, "ID=" );
442          strcat( result, strWindowId );          strcat( result, strWindowId );
443          strcat( result, ";" );          strcat( result, ";" );
444          strcat( result, "TITLE=" );          strcat( result, "TITLE=" );
445          strcat( result, windowTitle );          strcat( result, windowTitle );
446          strcat( result, ";" );          strcat( result, ";" );
447          strcat( result, "POS=" );          strcat( result, "X=" );
448          strcat( result, strL );          strcat( result, strX );
449          strcat( result, "~" );          strcat( result, ";" );
450          strcat( result, strT );          strcat( result, "Y=" );
451          strcat( result, "~" );          strcat( result, strY );
         strcat( result, strR );  
         strcat( result, "~" );  
         strcat( result, strB );  
452          strcat( result, ";" );          strcat( result, ";" );
453            strcat( result, "H=" );
454            strcat( result, strH );
455            strcat( result, ";" );
456            strcat( result, "W=" );
457            strcat( result, strW );
458            strcat( result, "." );
459                    
460          buffer = result;          buffer = result;
461                    
# Line 326  LRESULT CALLBACK ShellProc( int nCode, W Line 494  LRESULT CALLBACK ShellProc( int nCode, W
494                               };                               };
495          char strWindowId[ 25 ];          char strWindowId[ 25 ];
496          LONG b, t, l, r;          LONG b, t, l, r;
497          char strB[ 5 ];          char strW[ 5 ];
498          char strT[ 5 ];          char strY[ 5 ];
499          char strL[ 5 ];          char strX[ 5 ];
500          char strR[ 5 ];          char strH[ 5 ];
501          RECT rect;          RECT rect;
502                    
503          switch ( nCode ) {          switch ( nCode ) {
# Line 345  LRESULT CALLBACK ShellProc( int nCode, W Line 513  LRESULT CALLBACK ShellProc( int nCode, W
513              t = rect.top;              t = rect.top;
514              l = rect.left;              l = rect.left;
515              r = rect.right;              r = rect.right;
516              ltoa( b, strB, 10 );              ltoa( b - t, strH, 10 );
517              ltoa( t, strT, 10 );              ltoa( t, strY, 10 );
518              ltoa( r, strR, 10 );              ltoa( r - l, strW, 10 );
519              ltoa( l, strL, 10 );              ltoa( l, strX, 10 );
520                            
521              //get name              //get name
522              GetWindowText( windowHandle, windowTitle, 150 );              GetWindowText( windowHandle, windowTitle, 150 );
523                            
524              ////setup return string              ////setup return string
525              strcat( result, "MSG=HSHELL_WINDOWCREATED;" );              strcat( result, "MSG=HSHELL_WINDOWCREATED;OP=0;" );
526              strcat( result, "ID=" );              strcat( result, "ID=" );
527              strcat( result, strWindowId );              strcat( result, strWindowId );
528              strcat( result, ";" );              strcat( result, ";" );
529              strcat( result, "TITLE=" );              strcat( result, "TITLE=" );
530              strcat( result, windowTitle );              strcat( result, windowTitle );
531              strcat( result, ";" );              strcat( result, ";" );
532              strcat( result, "POS=" );              strcat( result, "X=" );
533              strcat( result, strL );              strcat( result, strX );
534              strcat( result, "~" );              strcat( result, ";" );
535              strcat( result, strT );              strcat( result, "Y=" );
536              strcat( result, "~" );              strcat( result, strY );
             strcat( result, strR );  
             strcat( result, "~" );  
             strcat( result, strB );  
537              strcat( result, ";" );              strcat( result, ";" );
538                strcat( result, "H=" );
539                strcat( result, strH );
540                strcat( result, ";" );
541                strcat( result, "W=" );
542                strcat( result, strW );
543                strcat( result, "." );
544                            
545              buffer = result;              buffer = result;
546                            
# Line 381  LRESULT CALLBACK ShellProc( int nCode, W Line 552  LRESULT CALLBACK ShellProc( int nCode, W
552              windowHandle = ( HWND ) wParam;              windowHandle = ( HWND ) wParam;
553              itoa( ( int ) windowHandle, strWindowId, 10 );              itoa( ( int ) windowHandle, strWindowId, 10 );
554                            
555                //get coords
556                GetWindowRect( windowHandle, &rect );
557                b = rect.bottom;
558                t = rect.top;
559                l = rect.left;
560                r = rect.right;
561                ltoa( b - t, strH, 10 );
562                ltoa( t, strY, 10 );
563                ltoa( r - l, strW, 10 );
564                ltoa( l, strX, 10 );
565                
566              //get name              //get name
567              GetWindowText( windowHandle, windowTitle, 150 );              GetWindowText( windowHandle, windowTitle, 150 );
568                            
569              ////setup return string              ////setup return string
570              strcat( result, "MSG=HSHELL_WINDOWDESTROYED;" );              strcat( result, "MSG=HSHELL_WINDOWDESTROYED;OP=1;" );
571              strcat( result, "ID=" );              strcat( result, "ID=" );
572              strcat( result, strWindowId );              strcat( result, strWindowId );
573              strcat( result, ";" );              strcat( result, ";" );
574              strcat( result, "TITLE=" );              strcat( result, "TITLE=" );
575              strcat( result, windowTitle );              strcat( result, windowTitle );
576              strcat( result, ";" );              strcat( result, ";" );
577                strcat( result, "X=" );
578                strcat( result, strX );
579                strcat( result, ";" );
580                strcat( result, "Y=" );
581                strcat( result, strY );
582                strcat( result, ";" );
583                strcat( result, "H=" );
584                strcat( result, strH );
585                strcat( result, ";" );
586                strcat( result, "W=" );
587                strcat( result, strW );
588                strcat( result, "." );
589                            
590              buffer = result;              buffer = result;
591                            
# Line 411  LRESULT CALLBACK ShellProc( int nCode, W Line 605  LRESULT CALLBACK ShellProc( int nCode, W
605  DLL_EXPORT void SetCbtHook( void )  DLL_EXPORT void SetCbtHook( void )
606  {  {
607      if ( !bHooked ) {      if ( !bHooked ) {
608          hhook =          hhook = SetWindowsHookEx( WH_CBT, ( HOOKPROC ) CbtProc, hInst, ( DWORD ) NULL );
             SetWindowsHookEx( WH_CBT, ( HOOKPROC ) CbtProc, hInst, ( DWORD ) NULL );  
609          bHooked = true;          bHooked = true;
610      }      }
611            
612      if ( !bHooked2 ) {      if ( !bHooked2 ) {
613          hhook2 =          hhook2 = SetWindowsHookEx( WH_SHELL, ( HOOKPROC ) ShellProc, hInst, ( DWORD ) NULL );
             SetWindowsHookEx( WH_SHELL, ( HOOKPROC ) ShellProc, hInst,  
                               ( DWORD ) NULL );  
614          bHooked2 = true;          bHooked2 = true;
615      }      }
616            
617      if ( !bHooked3 ) {      if ( !bHooked3 ) {
618          hhook3 =          hhook3 = SetWindowsHookEx( WH_CALLWNDPROC, ( HOOKPROC ) CallWndProc, hInst, ( DWORD ) NULL );
             SetWindowsHookEx( WH_CALLWNDPROC, ( HOOKPROC ) CallWndProc, hInst,  
                               ( DWORD ) NULL );  
619          bHooked3 = true;          bHooked3 = true;
620      }      }
621  }  }
# Line 456  DLL_EXPORT int GetInstanceCount() Line 645  DLL_EXPORT int GetInstanceCount()
645    
646  int OpenVirtualChannel()  int OpenVirtualChannel()
647  {  {
648      m_vcHandle =      m_vcHandle = WTSVirtualChannelOpen( WTS_CURRENT_SERVER_HANDLE, WTS_CURRENT_SESSION, CHANNELNAME );
649          WTSVirtualChannelOpen( WTS_CURRENT_SERVER_HANDLE, WTS_CURRENT_SESSION,      
                                CHANNELNAME );  
                                 
650      if ( m_vcHandle == NULL ) {      if ( m_vcHandle == NULL ) {
651          return 0;          return 0;
652      } else {      } else {
# Line 494  int WriteToChannel( PCHAR buffer ) Line 681  int WriteToChannel( PCHAR buffer )
681      PULONG bytesRead = 0;      PULONG bytesRead = 0;
682      PULONG pBytesWritten = 0;      PULONG pBytesWritten = 0;
683            
684      BOOL result =      BOOL result = WTSVirtualChannelWrite( m_vcHandle, buffer, ( ULONG ) strlen( buffer ), pBytesWritten );
685          WTSVirtualChannelWrite( m_vcHandle, buffer, ( ULONG ) strlen( buffer ),      
                                 pBytesWritten );  
                                   
686      if ( result ) {      if ( result ) {
687          return 1;          return 1;
688      } else {      } else {

Legend:
Removed from v.993  
changed lines
  Added in v.995

  ViewVC Help
Powered by ViewVC 1.1.26