Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Unified Diff: tools/win/ChromeDebug/LowLevel/NativeMethods.cs

Issue 23480085: Initial submit of ChromeDebug extension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add README.txt Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/win/ChromeDebug/LowLevel/NativeMethods.cs
diff --git a/tools/win/ChromeDebug/LowLevel/NativeMethods.cs b/tools/win/ChromeDebug/LowLevel/NativeMethods.cs
new file mode 100644
index 0000000000000000000000000000000000000000..08a47a038cac0cab6c2e8002fa7b3e7e9d000ee4
--- /dev/null
+++ b/tools/win/ChromeDebug/LowLevel/NativeMethods.cs
@@ -0,0 +1,65 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+using Microsoft.Win32.SafeHandles;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ChromeDebug.LowLevel {
+ public static class NativeMethods {
+ [DllImport("kernel32.dll", SetLastError = true)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool ReadProcessMemory(IntPtr hProcess,
+ IntPtr lpBaseAddress,
+ IntPtr lpBuffer,
+ int dwSize,
+ out int lpNumberOfBytesRead);
+
+ [DllImport("ntdll.dll", SetLastError = true)]
+ public static extern LowLevelTypes.NTSTATUS NtQueryInformationProcess(
+ IntPtr hProcess,
+ LowLevelTypes.PROCESSINFOCLASS pic,
+ ref LowLevelTypes.PROCESS_BASIC_INFORMATION pbi,
+ int cb,
+ out int pSize);
+
+ [DllImport("shell32.dll", SetLastError = true)]
+ public static extern IntPtr CommandLineToArgvW(
+ [MarshalAs(UnmanagedType.LPWStr)] string lpCmdLine,
+ out int pNumArgs);
+
+ [DllImport("kernel32.dll", SetLastError = true)]
+ public static extern IntPtr LocalFree(IntPtr hMem);
+
+ [DllImport("kernel32.dll", SetLastError = true)]
+ public static extern IntPtr OpenProcess(
+ LowLevelTypes.ProcessAccessFlags dwDesiredAccess,
+ [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle,
+ int dwProcessId);
+
+ [DllImport("kernel32.dll", SetLastError = true, CallingConvention = CallingConvention.StdCall,
+ CharSet = CharSet.Unicode)]
+ public static extern uint QueryFullProcessImageName(
+ IntPtr hProcess,
+ [MarshalAs(UnmanagedType.U4)] LowLevelTypes.ProcessQueryImageNameMode flags,
+ [Out] StringBuilder lpImageName, ref int size);
+
+ [DllImport("kernel32.dll", SetLastError = true)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool CloseHandle(IntPtr hObject);
+
+ [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
+ public static extern SafeFileHandle CreateFile(string lpFileName,
+ LowLevelTypes.FileAccessFlags dwDesiredAccess,
+ LowLevelTypes.FileShareFlags dwShareMode,
+ IntPtr lpSecurityAttributes,
+ LowLevelTypes.FileCreationDisposition dwDisp,
+ LowLevelTypes.FileFlagsAndAttributes dwFlags,
+ IntPtr hTemplateFile);
+ }
+}
« no previous file with comments | « tools/win/ChromeDebug/LowLevel/LowLevel.csproj ('k') | tools/win/ChromeDebug/LowLevel/Properties/AssemblyInfo.cs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698