/[rdesktop]/sourceforge.net/trunk/seamlessrdp/ServerExe/main.c
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/main.c

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

revision 1071 by ossman_, Thu Mar 9 12:00:15 2006 UTC revision 1074 by ossman_, Thu Mar 9 13:24:35 2006 UTC
# Line 25  Line 25 
25  #include <windows.h>  #include <windows.h>
26  #include <stdio.h>  #include <stdio.h>
27    
28    #include "vchannel.h"
29    
30  #include "resource.h"  #include "resource.h"
31    
32  #define APP_NAME "SeamlessRDP Shell"  #define APP_NAME "SeamlessRDP Shell"
# Line 42  message(const char *text) Line 44  message(const char *text)
44          MessageBox(GetDesktopWindow(), text, "SeamlessRDP Shell", MB_OK);          MessageBox(GetDesktopWindow(), text, "SeamlessRDP Shell", MB_OK);
45  }  }
46    
47    static void
48    process_cmds(void)
49    {
50            char line[VCHANNEL_MAX_LINE];
51            int size;
52    
53            while ((size = vchannel_read(line, sizeof(line))) >= 0) {
54                    debug("Got: %s", line);
55            }
56    }
57    
58  int WINAPI  int WINAPI
59  WinMain(HINSTANCE instance, HINSTANCE prev_instance, LPSTR cmdline, int cmdshow)  WinMain(HINSTANCE instance, HINSTANCE prev_instance, LPSTR cmdline, int cmdshow)
60  {  {
# Line 79  WinMain(HINSTANCE instance, HINSTANCE pr Line 92  WinMain(HINSTANCE instance, HINSTANCE pr
92                  return -1;                  return -1;
93          }          }
94    
95            vchannel_open();
96    
97          set_hooks_fn();          set_hooks_fn();
98    
99          if (strlen(cmdline) == 0)          if (strlen(cmdline) == 0)
# Line 103  WinMain(HINSTANCE instance, HINSTANCE pr Line 118  WinMain(HINSTANCE instance, HINSTANCE pr
118                  {                  {
119                          do                          do
120                          {                          {
121                                  Sleep(1000);                                  process_cmds();
122                                    Sleep(100);
123                                  GetExitCodeProcess(proc_info.hProcess, &exitcode);                                  GetExitCodeProcess(proc_info.hProcess, &exitcode);
124                          }                          }
125                          while (exitcode == STILL_ACTIVE);                          while (exitcode == STILL_ACTIVE);
# Line 126  WinMain(HINSTANCE instance, HINSTANCE pr Line 142  WinMain(HINSTANCE instance, HINSTANCE pr
142    
143          FreeLibrary(hookdll);          FreeLibrary(hookdll);
144    
145            vchannel_close();
146    
147          return 1;          return 1;
148  }  }

Legend:
Removed from v.1071  
changed lines
  Added in v.1074

  ViewVC Help
Powered by ViewVC 1.1.26