コード例 #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);