Index: inc/TWinNTSystem.h
===================================================================
RCS file: /user/cvs/root/winnt/inc/TWinNTSystem.h,v
retrieving revision 1.8
diff -u -r1.8 TWinNTSystem.h
--- TWinNTSystem.h	2001/06/06 16:48:33	1.8
+++ TWinNTSystem.h	2001/09/17 22:18:52
@@ -64,7 +64,8 @@
 class TWinNTSystem : public TSystem {
 
 protected:
-   HANDLE          fhProcess;         // Handle of the current process
+   HANDLE          fhProcess;         // Handle of the current process
+   HANDLE          fhTermInputEvent;  // Handle of "event" to suspend "dummy" terminal loop
    char           *fDirNameBuffer;    // The string buffer to hold path name
    WIN32_FIND_DATA  fFindFileData;    // Structure to look for files (aka OpenDir under UNIX)
 
@@ -128,6 +129,9 @@
    //---- EventLoop --------------------------------------------
    Bool_t            ProcessEvents();
    void              DispatchOneEvent(Bool_t pendingOnly = kFALSE);
+
+   void              ExitLoop();
+   void              InnerLoop();
 
    //---- Handling of system events
    void              CheckChilds();
@@ -136,7 +140,7 @@
    void              AddSignalHandler(TSignalHandler *sh);
    TSignalHandler   *RemoveSignalHandler(TSignalHandler *sh);
    void              ResetSignal(ESignals sig, Bool_t reset = kTRUE);
-   void              IgnoreSignal(ESignals sig, Bool_t ignore = kTRUE);
+   void              IgnoreSignal(ESignals sig, Bool_t ignore = kTRUE);
    void              AddFileHandler(TFileHandler *fh);
    TFileHandler     *RemoveFileHandler(TFileHandler *fh);
    BOOL              HandleConsoleEvent();
Index: src/TWinNTSystem.cxx
===================================================================
RCS file: /user/cvs/root/winnt/src/TWinNTSystem.cxx,v
retrieving revision 1.18
diff -u -r1.18 TWinNTSystem.cxx
--- TWinNTSystem.cxx	2001/06/17 23:08:45	1.18
+++ TWinNTSystem.cxx	2001/09/17 22:19:14
@@ -227,7 +227,9 @@
   }
 
  if (fhSmallIconList)  {ImageList_Destroy(fhSmallIconList);  fhSmallIconList = 0; }
- if (fhNormalIconList) {ImageList_Destroy(fhNormalIconList); fhNormalIconList = 0; }
+ if (fhNormalIconList) {ImageList_Destroy(fhNormalIconList); fhNormalIconList = 0; }
+
+ CloseHandle(fhTermInputEvent);
 
 }
 
@@ -280,6 +282,8 @@
 //*-*  The the name of the DLL to be used as a stock of the icon
    SetShellName();
    CreateIcons();
+//*-*   Create Event HANDLE for stand-alone ROOT-based app;liactions
+    fhTermInputEvent = CreateEvent(NULL,TRUE,FALSE,NULL);
 
    return kFALSE;
 }
@@ -632,7 +636,11 @@
 {
  // Dispatch a single event via Command thread
 
-  gROOT->GetApplication()->HandleTermInput();
+  if (gROOT->GetApplication()->HandleTermInput() == -1) {
+      // wait ExitLoop()
+      WaitForSingleObject(fhTermInputEvent,INFINITE);
+      ResetEvent(fhTermInputEvent);     
+  }
 #if 0
      // check for file descriptors ready for reading/writing
   if (fNfd > 0 && fFileHandler->GetSize() > 0) {
@@ -699,6 +707,19 @@
 #endif
 
 }
+
+//______________________________________________________________________________
+void TWinNTSystem::ExitLoop()
+{
+  TSystem::ExitLoop();
+  // Release Displach one event
+  SetEvent(fhTermInputEvent);
+}
+//______________________________________________________________________________
+void TWinNTSystem::InnerLoop()
+{
+  TSystem::InnerLoop();
+}
 
 //---- handling of system events -----------------------------------------------
 
@@ -948,7 +969,8 @@
        char *r = max(rslash, bslash);
        const char *ptr = pathname;
        while (ptr <= r) {
-         if (*ptr == ':') {
+         if (*ptr == ':')
+         {
            // Windows path may contain a drive letter
            // For NTFS ":" may be a "stream" delimiter as well
            pathname =  ptr + 1;
@@ -2858,68 +2880,10 @@
 
 //---- Dynamic Loading ---------------------------------------------------------
 
-#ifdef R__HPUX
 //______________________________________________________________________________
-static const char *DynamicPathName(const char *lib)
-{
-   // Returns the path of a shared library (searches for library in the
-   // shared library search path). If no file name extension is provided
-   // it first tries .so, sl and then .dl. Static utility function.
-
-   const char *name = lib;
-
-   if (!strchr(name, '.')) {
-      name = Form("%s.dll", lib);
-      name = gSystem->Which(GetDynamicPath(), name, kReadPermission);
-   } else {
-
-      int len = strlen(name);
-      if (len > 4 && (!strcmp(name+len-4, ".dll"))
-         name = gSystem->Which(GetDynamicPath(), name, kReadPermission);
-      else {
-         ::Error("TUnixSystem::DynamicPathName",
-                 "shared library must have extension: .dll", lib);
-         name = 0;
-      }
-   }
-   return name;
-}
-
-//______________________________________________________________________________
-static shl_t FindDynLib(const char *lib)
-{
-   // Returns the handle to a loaded shared library. Returns 0 when library
-   // not loaded.
-
-   const char *path;
-
-   if (path = DynamicPathName(lib)) {
-      // find handle of shared library using its name
-      struct shl_descriptor *desc;
-      int index = 0;
-      while (shl_get(index++, &desc) == 0)
-         if (!strcmp(path, desc->filename))
-            return desc->handle;
-   }
-   return 0;
-}
-#endif
-
-//______________________________________________________________________________
 int TWinNTSystem::WinNTDynLoad(const char *lib)
 {
    // Load a shared library. Returns 0 on successful loading.
-
-#ifdef R__HPUX
-   const char *path;
-
-   if (path = DynamicPathName(lib)) {
-//    shl_t handle = cxxshl_load(path, BIND_DEFERRED, 0L);
-      shl_t handle = cxxshl_load(path, BIND_IMMEDIATE | BIND_NONFATAL, 0L);
-      if (handle) return 0;
-   }
-   return 1;
-#endif
         return 0;
 }
 
@@ -2928,18 +2892,6 @@
 {
    // Finds and returns a function pointer to a symbol in the shared library.
    // Returns 0 when symbol not found.
-
-#ifdef R__HPUX
-   shl_t handle;
-
-   if (handle = FindDynLib(lib)) {
-      Func_t addr;
-      if (shl_findsym(&handle, entry, TYPE_PROCEDURE, addr) == -1)
-         ::SysError("TWinNTSystem::WinNTDynFindSymbol", "shl_findsym");
-      return addr;
-   }
-   return 0;
-#endif
 
    // Assume always found
    return (Func_t)1;

