예제 #1
0
 public Toolhelp32Snapshot(Toolhelp32SnapshotFlags flags)
 {
     try {
         handle = CreateToolhelp32Snapshot((uint)flags, 0);
         if (handle.IsInvalid)
         {
             throw new Win32Exception();
         }
     } catch (Win32Exception err) when(err.NativeErrorCode == IncompleteReadException.ErrorNumber)
     {
         throw new IncompleteReadException(err);
     }
 }
예제 #2
0
 public Toolhelp32Snapshot(Toolhelp32SnapshotFlags flags, UInt32 processId)
 {
     if (processId == 0)
     {
         throw new ArgumentOutOfRangeException(nameof(processId), "The process id can't be zero!");
     }
     if ((flags & Toolhelp32SnapshotFlags.Thread) == Toolhelp32SnapshotFlags.Thread)
     {
         throw new ArgumentException("Per process thread filtering doesn't work.");
     }
     try {
         handle = CreateToolhelp32Snapshot((uint)flags, processId);
         if (handle.IsInvalid)
         {
             throw new Win32Exception();
         }
     } catch (Win32Exception err) when(err.NativeErrorCode == IncompleteReadException.ErrorNumber)
     {
         throw new IncompleteReadException(err);
     }
 }
예제 #3
0
 internal static extern bool Thread32Next(SafeToolhelp32SnapshotHandle handle, ref ThreadEntry.Native moduleEntry);
예제 #4
0
 internal static extern bool Process32NextW(SafeToolhelp32SnapshotHandle handle, ref ProcessEntry.Native moduleEntry);
예제 #5
0
 internal static extern bool Module32NextW(SafeToolhelp32SnapshotHandle handle, ref ModuleEntry.Native moduleEntry);