private string GetInformationUnicodeString(DriverInformationClass infoClass) { using (MemoryAlloc data = new MemoryAlloc(0x1000)) { int retLength = 0; try { KProcessHacker.Instance.KphQueryInformationDriver( this, infoClass, data, data.Size, out retLength ); } catch (WindowsException) { data.ResizeNew(retLength); KProcessHacker.Instance.KphQueryInformationDriver( this, infoClass, data, data.Size, out retLength ); } return data.ReadStruct<UnicodeString>().Read(); } }
private string GetInformationUnicodeString(DriverInformationClass infoClass) { using (MemoryAlloc data = new MemoryAlloc(0x1000)) { int retLength = 0; try { KProcessHacker.Instance.KphQueryInformationDriver( this, infoClass, data, data.Size, out retLength ); } catch (WindowsException) { data.Resize(retLength); KProcessHacker.Instance.KphQueryInformationDriver( this, infoClass, data, data.Size, out retLength ); } return(data.ReadStruct <UnicodeString>().Read()); } }
private string GetInformationUnicodeString(DriverInformationClass infoClass) { using (MemoryAlloc data = new MemoryAlloc(0x1000)) { int retLength = 0; //try //{ // KProcessHacker.Instance.KphQueryInformationDriver( // this, // infoClass, // data, // data.Size, // out retLength // ); //} //catch (WindowsException) //{ // data.ResizeNew(retLength); // KProcessHacker.Instance.KphQueryInformationDriver( // this, // infoClass, // data, // data.Size, // out retLength // ); //} return(data.ReadStruct <UnicodeString>().Text); } }
private string GetInformationUnicodeString(DriverInformationClass infoClass) { using (MemoryAlloc data = new MemoryAlloc(0x1000)) { int retLength = 0; //try //{ // KProcessHacker.Instance.KphQueryInformationDriver( // this, // infoClass, // data, // data.Size, // out retLength // ); //} //catch (WindowsException) //{ // data.ResizeNew(retLength); // KProcessHacker.Instance.KphQueryInformationDriver( // this, // infoClass, // data, // data.Size, // out retLength // ); //} return data.ReadStruct<UnicodeString>().Text; } }
public void KphQueryInformationDriver( DriverHandle driverHandle, DriverInformationClass driverInformationClass, IntPtr driverInformation, int driverInformationLength, out int returnLength ) { byte *inData = stackalloc byte[0x14]; int returnLengthLocal; *(int *)inData = driverHandle; *(int *)(inData + 0x4) = (int)driverInformationClass; *(int *)(inData + 0x8) = driverInformation.ToInt32(); *(int *)(inData + 0xc) = driverInformationLength; *(int *)(inData + 0x10) = (int)&returnLengthLocal; try { _fileHandle.IoControl(CtlCode(Control.KphQueryInformationDriver), inData, 0x14, null, 0); } finally { returnLength = returnLengthLocal; } }
public void KphQueryInformationDriver( DriverHandle driverHandle, DriverInformationClass driverInformationClass, IntPtr driverInformation, int driverInformationLength, out int returnLength ) { byte* inData = stackalloc byte[0x14]; int returnLengthLocal; *(int*)inData = driverHandle; *(int*)(inData + 0x4) = (int)driverInformationClass; *(int*)(inData + 0x8) = driverInformation.ToInt32(); *(int*)(inData + 0xc) = driverInformationLength; *(int*)(inData + 0x10) = (int)&returnLengthLocal; try { _fileHandle.IoControl(CtlCode(Control.KphQueryInformationDriver), inData, 0x14, null, 0); } finally { returnLength = returnLengthLocal; } }