-
Notifications
You must be signed in to change notification settings - Fork 23
/
driver.h
63 lines (51 loc) · 1.76 KB
/
driver.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* =========================================================
* Driver.cpp
* *********************************************************
*
* Class: CDriver_Loader
*
* Author: Dan Revah
*
* Date: 03/12/2011 (DD/MM/YYYY)
* Version: 1.00
*
* (-!-) Kernel-mode driver loader
* - Injecting into windows kernel
* ======================================================== */
#ifndef _DRIVER_H_
#define _DRIVER_H_
#include <windows.h>
#include <exception>
#define SVC_OK 0x01
/* ================================================
* Begin CDriver_Loader Class Definition
* ================================================= */
class CDriver_Loader {
public:
// Constructors
CDriver_Loader(); // Default constructor
CDriver_Loader(LPTSTR, LPTSTR, LPTSTR, DWORD); // Initalzing
// Destructor
~CDriver_Loader();
// Status functions
inline bool isInit() const { return init; }
inline bool isLoaded() const { return loaded; }
inline bool isStarted() const { return started; }
// Driver service functions
DWORD InitSvc(LPTSTR filePath, LPTSTR serviceName, LPTSTR displayName, DWORD startType); // initalizing the driver service
DWORD CreateSvc(); // Creating the driver service
DWORD StartSvc(); // Starting the driver service
DWORD StopSvc(); // Starting the driver service
DWORD UnloadSvc(); // Unload the driver service
private:
LPTSTR mFilePath; //driver file path
LPTSTR mServiceName; //service name
LPTSTR mDisplayName; //dos service name
DWORD mStartType; //start type
SC_HANDLE mService; //service's handle
// Status variables
bool init;
bool loaded;
bool started;
};
#endif