1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/External/WinRing0/OpenLibSys.h Sun May 27 16:50:01 2012 +0000
1.3 @@ -0,0 +1,131 @@
1.4 +//-----------------------------------------------------------------------------
1.5 +// Author : hiyohiyo
1.6 +// Mail : hiyohiyo@crystalmark.info
1.7 +// Web : http://openlibsys.org/
1.8 +// License : The modified BSD license
1.9 +//
1.10 +// Copyright 2007-2008 OpenLibSys.org. All rights reserved.
1.11 +//-----------------------------------------------------------------------------
1.12 +
1.13 +#include <ntddk.h>
1.14 +#include <devioctl.h>
1.15 +#include "OlsIoctl.h"
1.16 +
1.17 +//-----------------------------------------------------------------------------
1.18 +//
1.19 +// Device Name
1.20 +//
1.21 +//-----------------------------------------------------------------------------
1.22 +
1.23 +#define NT_DEVICE_NAME L"\\Device\\WinRing0_1_2_0"
1.24 +#define DOS_DEVICE_NAME L"\\DosDevices\\WinRing0_1_2_0"
1.25 +
1.26 +//-----------------------------------------------------------------------------
1.27 +//
1.28 +// Function Prototypes
1.29 +//
1.30 +//-----------------------------------------------------------------------------
1.31 +
1.32 +NTSTATUS DriverEntry(
1.33 + IN PDRIVER_OBJECT DriverObject,
1.34 + IN PUNICODE_STRING RegistryPath
1.35 + );
1.36 +
1.37 +NTSTATUS OlsDispatch(
1.38 + IN PDEVICE_OBJECT pDO,
1.39 + IN PIRP pIrp
1.40 + );
1.41 +
1.42 +VOID Unload(
1.43 + IN PDRIVER_OBJECT DriverObject
1.44 + );
1.45 +
1.46 +//-----------------------------------------------------------------------------
1.47 +//
1.48 +// Function Prototypes for Control Code
1.49 +//
1.50 +//-----------------------------------------------------------------------------
1.51 +
1.52 +NTSTATUS ReadMsr(
1.53 + void *lpInBuffer,
1.54 + ULONG nInBufferSize,
1.55 + void *lpOutBuffer,
1.56 + ULONG nOutBufferSize,
1.57 + ULONG *lpBytesReturned
1.58 + );
1.59 +
1.60 +NTSTATUS WriteMsr(
1.61 + void *lpInBuffer,
1.62 + ULONG nInBufferSize,
1.63 + void *lpOutBuffer,
1.64 + ULONG nOutBufferSize,
1.65 + ULONG *lpBytesReturned
1.66 + );
1.67 +
1.68 +NTSTATUS ReadPmc(
1.69 + void *lpInBuffer,
1.70 + ULONG nInBufferSize,
1.71 + void *lpOutBuffer,
1.72 + ULONG nOutBufferSize,
1.73 + ULONG *lpBytesReturned
1.74 + );
1.75 +
1.76 +NTSTATUS ReadIoPort(
1.77 + ULONG ioControlCode,
1.78 + void *lpInBuffer,
1.79 + ULONG nInBufferSize,
1.80 + void *lpOutBuffer,
1.81 + ULONG nOutBufferSize,
1.82 + ULONG *lpBytesReturned
1.83 + );
1.84 +
1.85 +NTSTATUS WriteIoPort(
1.86 + ULONG ioControlCode,
1.87 + void *lpInBuffer,
1.88 + ULONG nInBufferSize,
1.89 + void *lpOutBuffer,
1.90 + ULONG nOutBufferSize,
1.91 + ULONG *lpBytesReturned
1.92 + );
1.93 +
1.94 +NTSTATUS ReadPciConfig(
1.95 + void *lpInBuffer,
1.96 + ULONG nInBufferSize,
1.97 + void *lpOutBuffer,
1.98 + ULONG nOutBufferSize,
1.99 + ULONG *lpBytesReturned
1.100 + );
1.101 +
1.102 +NTSTATUS WritePciConfig(
1.103 + void *lpInBuffer,
1.104 + ULONG nInBufferSize,
1.105 + void *lpOutBuffer,
1.106 + ULONG nOutBufferSize,
1.107 + ULONG *lpBytesReturned
1.108 + );
1.109 +
1.110 +NTSTATUS ReadMemory(
1.111 + void *lpInBuffer,
1.112 + ULONG nInBufferSize,
1.113 + void *lpOutBuffer,
1.114 + ULONG nOutBufferSize,
1.115 + ULONG *lpBytesReturned
1.116 + );
1.117 +
1.118 +NTSTATUS WriteMemory(
1.119 + void *lpInBuffer,
1.120 + ULONG nInBufferSize,
1.121 + void *lpOutBuffer,
1.122 + ULONG nOutBufferSize,
1.123 + ULONG *lpBytesReturned
1.124 + );
1.125 +
1.126 +
1.127 +//-----------------------------------------------------------------------------
1.128 +//
1.129 +// Support Function Prototypes
1.130 +//
1.131 +//-----------------------------------------------------------------------------
1.132 +
1.133 +NTSTATUS pciConfigRead(ULONG pciAddress, ULONG offset, void *data, int length);
1.134 +NTSTATUS pciConfigWrite(ULONG pciAddress, ULONG offset, void *data, int length);