Example #1
0
        private string QueryProcessImageName(SafeProcessHandle handle, ProcessQueryImageNameMode mode)
        {
            StringBuilder moduleBuffer = new StringBuilder(1024);
            int           size         = moduleBuffer.Capacity;

            NativeMethods.QueryFullProcessImageName(
                handle, mode, moduleBuffer, ref size);
            if (mode == ProcessQueryImageNameMode.NativeSystemFormat)
            {
                moduleBuffer.Insert(0, "\\\\?\\GLOBALROOT");
            }
            return(moduleBuffer.ToString());
        }
Example #2
0
 public static extern uint QueryFullProcessImageName(
     SafeProcessHandle hProcess,
     [MarshalAs(UnmanagedType.U4)] ProcessQueryImageNameMode flags,
     [Out] StringBuilder lpImageName, ref int size);
Example #3
0
 private string QueryProcessImageName(SafeProcessHandle handle, ProcessQueryImageNameMode mode)
 {
     StringBuilder moduleBuffer = new StringBuilder(1024);
       int size = moduleBuffer.Capacity;
       NativeMethods.QueryFullProcessImageName(
     handle, mode, moduleBuffer, ref size);
       if (mode == ProcessQueryImageNameMode.NativeSystemFormat)
     moduleBuffer.Insert(0, "\\\\?\\GLOBALROOT");
       return moduleBuffer.ToString();
 }