internal DirMonCompletion(DirectoryMonitor dirMon, string dir, bool watchSubtree, uint notifyFilter)
 {
     this._dirMon = dirMon;
     NativeFileChangeNotification notification = new NativeFileChangeNotification(this.OnFileChange);
     this._rootCallback = GCHandle.Alloc(notification);
     int hr = UnsafeNativeMethods.DirMonOpen(dir, HttpRuntime.AppDomainAppIdInternal, watchSubtree, notifyFilter, notification, out this._ndirMonCompletionPtr);
     if (hr != 0)
     {
         this._rootCallback.Free();
         throw FileChangesMonitor.CreateFileMonitoringException(hr, dir);
     }
     this._ndirMonCompletionHandle = new HandleRef(this, this._ndirMonCompletionPtr);
     Interlocked.Increment(ref _activeDirMonCompletions);
 }
        internal DirMonCompletion(DirectoryMonitor dirMon, string dir, bool watchSubtree, uint notifyFilter)
        {
            this._dirMon = dirMon;
            NativeFileChangeNotification notification = new NativeFileChangeNotification(this.OnFileChange);

            this._rootCallback = GCHandle.Alloc(notification);
            int hr = UnsafeNativeMethods.DirMonOpen(dir, HttpRuntime.AppDomainAppIdInternal, watchSubtree, notifyFilter, notification, out this._ndirMonCompletionPtr);

            if (hr != 0)
            {
                this._rootCallback.Free();
                throw FileChangesMonitor.CreateFileMonitoringException(hr, dir);
            }
            this._ndirMonCompletionHandle = new HandleRef(this, this._ndirMonCompletionPtr);
            Interlocked.Increment(ref _activeDirMonCompletions);
        }
Exemplo n.º 3
0
 internal static extern int DirMonOpen(string dir, string appId, bool watchSubtree, uint notifyFilter, int fcnMode, NativeFileChangeNotification callback, out IntPtr pCompletion);
 internal /*public*/ static extern int DirMonOpen(string dir, bool watchSubtree, uint notifyFilter, NativeFileChangeNotification callback, out IntPtr pCompletion);