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

Side by Side Diff: tools/win/ChromeDebug/LowLevel/NativeMethods.cs

Issue 23526064: Resubmit of ChromeDebug extension with fixed license headers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 using Microsoft.Win32.SafeHandles;
6 using System;
7 using System.Collections.Generic;
8 using System.Linq;
9 using System.Runtime.InteropServices;
10 using System.Text;
11 using System.Threading.Tasks;
12
13 namespace ChromeDebug.LowLevel {
14 public static class NativeMethods {
15 [DllImport("kernel32.dll", SetLastError = true)]
16 [return: MarshalAs(UnmanagedType.Bool)]
17 public static extern bool ReadProcessMemory(IntPtr hProcess,
18 IntPtr lpBaseAddress,
19 IntPtr lpBuffer,
20 int dwSize,
21 out int lpNumberOfBytesRead);
22
23 [DllImport("ntdll.dll", SetLastError = true)]
24 public static extern LowLevelTypes.NTSTATUS NtQueryInformationProcess(
25 IntPtr hProcess,
26 LowLevelTypes.PROCESSINFOCLASS pic,
27 ref LowLevelTypes.PROCESS_BASIC_INFORMATION pbi,
28 int cb,
29 out int pSize);
30
31 [DllImport("shell32.dll", SetLastError = true)]
32 public static extern IntPtr CommandLineToArgvW(
33 [MarshalAs(UnmanagedType.LPWStr)] string lpCmdLine,
34 out int pNumArgs);
35
36 [DllImport("kernel32.dll", SetLastError = true)]
37 public static extern IntPtr LocalFree(IntPtr hMem);
38
39 [DllImport("kernel32.dll", SetLastError = true)]
40 public static extern IntPtr OpenProcess(
41 LowLevelTypes.ProcessAccessFlags dwDesiredAccess,
42 [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle,
43 int dwProcessId);
44
45 [DllImport("kernel32.dll", SetLastError = true, CallingConvention = CallingC onvention.StdCall,
46 CharSet = CharSet.Unicode)]
47 public static extern uint QueryFullProcessImageName(
48 IntPtr hProcess,
49 [MarshalAs(UnmanagedType.U4)] LowLevelTypes.ProcessQueryImageNameMode fl ags,
50 [Out] StringBuilder lpImageName, ref int size);
51
52 [DllImport("kernel32.dll", SetLastError = true)]
53 [return: MarshalAs(UnmanagedType.Bool)]
54 public static extern bool CloseHandle(IntPtr hObject);
55
56 [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
57 public static extern SafeFileHandle CreateFile(string lpFileName,
58 LowLevelTypes.FileAccessFlags dwDesiredAccess,
59 LowLevelTypes.FileShareFlags dwShareMode,
60 IntPtr lpSecurityAttributes,
61 LowLevelTypes.FileCreationDis position dwDisp,
62 LowLevelTypes.FileFlagsAndAtt ributes dwFlags,
63 IntPtr hTemplateFile);
64 }
65 }
OLDNEW
« 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