num4 = ((-((pJob.ClosePrinter(intPtr) > false) ? 1 : 0)) ? 1 : 0);
I have here a decompiled source can you check the CheckPrnJob() method why the boolean statements were decompiled that way?
[code snippet] int num4 = (-((pJob.OpenPrinter(pName, ref intPtr, ref pRINTER_DEFAULTS) > false) ? 1 : 0)) ? 1 : 0; num4 = ((-((pJob.ClosePrinter(intPtr) > false) ? 1 : 0)) ? 1 : 0);
[actual code] using Microsoft.VisualBasic.CompilerServices; using System; using System.Runtime.InteropServices; namespace WindowsApplication1 { [StandardModule] internal sealed class pJob { [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] public struct PRINTER_DEFAULTS { public IntPtr pDatatype; public IntPtr pDevMode; public int DesiredAccess; } private const int STANDARD_RIGHTS_REQUIRED = 983040; private const int PRINTER_ACCESS_ADMINISTER = 4; private const int PRINTER_ACCESS_USE = 8; private const int PRINTER_ALL_ACCESS = 983052; public const int PRINTER_CONTROL_PAUSE = 1; public const int PRINTER_CONTROL_RESUME = 2; public const int PRINTER_CONTROL_PURGE = 3; [DllImport("winspool.Drv", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode, EntryPoint = "OpenPrinterW", ExactSpelling = true, SetLastError = true)] private static extern bool OpenPrinter(string src, ref IntPtr hPrinter, ref pJob.PRINTER_DEFAULTS pd); [DllImport("winspool.Drv", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode, EntryPoint = "EnumJobsA", ExactSpelling = true, SetLastError = true)] private static extern int EnumJobs(int hPrinter, int FirstJob, int NoJobs, int Level, ref IntPtr pJob, int cdBuf, ref int pcbNeeded, ref int pcReturned); [DllImport("winspool.Drv", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode, EntryPoint = "SetPrinterA", ExactSpelling = true, SetLastError = true)] private static extern int SetPrinter(int hPrinter, int Level, ref IntPtr pPrinter, int Command); [DllImport("winspool.Drv", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] private static extern bool ClosePrinter(IntPtr hPrinter); [DllImport("kernel32", SetLastError = true)] private static extern void Sleep(int dwMilliseconds); public static bool CheckPrnJob(string pName) { int num = 0; int num2 = 10; int num3 = 1; pJob.PRINTER_DEFAULTS pRINTER_DEFAULTS; pRINTER_DEFAULTS.DesiredAccess = 983052; IntPtr intPtr; int num4 = (-((pJob.OpenPrinter(pName, ref intPtr, ref pRINTER_DEFAULTS) > false) ? 1 : 0)) ? 1 : 0; bool result; if (num4 == 0) { result = true; } else { int arg_45_0 = (int)intPtr; int arg_45_1 = num; int arg_45_2 = num2; int arg_45_3 = num3; IntPtr zero = IntPtr.Zero; int num5; int num6; num4 = pJob.EnumJobs(arg_45_0, arg_45_1, arg_45_2, arg_45_3, ref zero, 0, ref num5, ref num6); num4 = ((-((pJob.ClosePrinter(intPtr) > false) ? 1 : 0)) ? 1 : 0); result = (num5 != 0); } return result; } } }