Skip to content

Commit dc562c8

Browse files
authored
Merge pull request #25 from ntoskrnl7/env/WDK_10.0.22621.0_and_MSVC_14.33.31629
Env/wdk 10.0.22621.0 and msvc 14.33.31629
2 parents b345fc3 + 64236c2 commit dc562c8

File tree

26 files changed

+1159
-25
lines changed

26 files changed

+1159
-25
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ else()
3939
set(LDK_USE_RAISE_EXCEPTION OFF)
4040
set(LDK_USE_RTL_RAISE_EXCEPTION OFF)
4141
endif()
42-
CPMAddPackage("gh:ntoskrnl7/[email protected].4")
42+
CPMAddPackage("gh:ntoskrnl7/[email protected].5")
4343

4444
CPMAddPackage("gh:ntoskrnl7/FindWDK#master")
4545
list(APPEND CMAKE_MODULE_PATH "${FindWDK_SOURCE_DIR}/cmake")

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,25 @@ Provides features to support a better development environment in the kernel.
161161
* ntl::rpc::client [(tested)](./test/app/src/main.cpp#L4) [(tested)](./test/common/rpc.hpp)
162162
* I did not have enough time to implement the data serialization part myself, so I referred to the contents of the project below. thank you! :-)
163163
* [Eyal Z/zpp serializer](https://github.com/eyalz800/serializer)
164+
* ntl::irql
165+
* Class for KIRQL
166+
* Classes
167+
* ntl::irql [(tested)](./test/driver/src/ntl.cpp#L46)
168+
* Functions
169+
* ntl::raise_irql [(tested)](./test/driver/src/ntl.cpp#L49)
170+
* raise_irql_to_dpc_level [(tested)](./test/driver/src/ntl.cpp#L62)
171+
* raise_irql_to_synch_level [(tested)](./test/driver/src/ntl.cpp#L71)
172+
* ntl::spin_lock
173+
* Class for KSPIN_LOCK
174+
* Classes
175+
* ntl::spin_lock [(tested)](./test/driver/src/ntl.cpp#L80)
176+
* ntl::unique_lock [(tested)](./test/driver/src/ntl.cpp#L99)
177+
* ntl::resource
178+
* Class for ERESOURCE
179+
* Classes
180+
* ntl::resource [(tested)](./test/driver/src/ntl.cpp#L117)
181+
* ntl::unique_lock [(tested)](./test/driver/src/ntl.cpp#L156)
182+
* ntl::shared_lock [(tested)](./test/driver/src/ntl.cpp#L179)
164183

165184
## Requirements
166185

@@ -187,10 +206,12 @@ Provides features to support a better development environment in the kernel.
187206
* 14.26.28801
188207
* 14.29.30133
189208
* 14.31.31103
190-
* Windows Kit (SDK, WDK)
209+
* 14.33.31629
210+
* Windows Kits (SDK, WDK)
191211
* 10.0.17763.0
192212
* 10.0.18362.0
193213
* 10.0.22000.0
214+
* 10.0.22621.0
194215

195216
If the SDK and WDK versions are different, builds are more likely to fail. **If possible, it is recommended to build in the same environment as the SDK and WDK versions.**
196217

@@ -281,7 +302,7 @@ If the SDK and WDK versions are different, builds are more likely to fail. **If
281302
include(cmake/CPM.cmake)
282303
283304
set(CRTSYS_NTL_MAIN ON) # use ntl::main
284-
CPMAddPackage("gh:ntoskrnl7/[email protected].8")
305+
CPMAddPackage("gh:ntoskrnl7/[email protected].10")
285306
include(${crtsys_SOURCE_DIR}/cmake/CrtSys.cmake)
286307
287308
# add driver

docs/ko-kr.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ crtsys의 장점은 아래와 같습니다.
147147
* [x] Create device [(tested)](../test/driver/src/main.cpp#L44)
148148
* ntl::device
149149
* DEVICE_OBJECT에 대한 클래스
150-
* Features
150+
* 기능
151151
* [x] Device Extension [(tested)](../test/driver/src/main.cpp#L33)
152152
* [ ] IRP_MJ_CREATE
153153
* [ ] IRP_MJ_CLOSE
@@ -161,6 +161,25 @@ crtsys의 장점은 아래와 같습니다.
161161
* ntl::rpc::client [(tested)](../test/app/src/main.cpp#L4) [(tested)](../test/common/rpc.hpp)
162162
* 데이터 직렬화 부분을 직접 구현하기에는 시간이 부족하여 아래 프로젝트 내용을 참고했습니다. 감사합니다! :-)
163163
* [Eyal Z/zpp serializer](https://github.com/eyalz800/serializer)
164+
* ntl::irql
165+
* KIRQL에 대한 클래스
166+
* 클래스
167+
* ntl::irql [(tested)](../test/driver/src/ntl.cpp#L46)
168+
* 함수
169+
* ntl::raise_irql [(tested)](../test/driver/src/ntl.cpp#L49)
170+
* raise_irql_to_dpc_level [(tested)](../test/driver/src/ntl.cpp#L62)
171+
* raise_irql_to_synch_level [(tested)](../test/driver/src/ntl.cpp#L71)
172+
* ntl::spin_lock
173+
* KSPIN_LOCK에 대한 클래스
174+
* 클래스
175+
* ntl::spin_lock [(tested)](../test/driver/src/ntl.cpp#L80)
176+
* ntl::unique_lock [(tested)](../test/driver/src/ntl.cpp#L99)
177+
* ntl::resource
178+
* ERESOURCE에 대한 클래스
179+
* 클래스
180+
* ntl::resource [(tested)](../test/driver/src/ntl.cpp#L117)
181+
* ntl::unique_lock [(tested)](../test/driver/src/ntl.cpp#L156)
182+
* ntl::shared_lock [(tested)](../test/driver/src/ntl.cpp#L179)
164183

165184
## Requirements
166185

@@ -187,10 +206,12 @@ crtsys의 장점은 아래와 같습니다.
187206
* 14.26.28801
188207
* 14.29.30133
189208
* 14.31.31103
190-
* Windows Kit (SDK, WDK)
209+
* 14.33.31629
210+
* Windows Kits (SDK, WDK)
191211
* 10.0.17763.0
192212
* 10.0.18362.0
193213
* 10.0.22000.0
214+
* 10.0.22621.0
194215

195216
SDK와 WDK의 버전이 다르면 빌드가 실패할 가능성이 높으므로 **가능하다면 SDK와 WDK의 버전이 같은 환경에서 빌드하는것을 권장합니다.**
196217

@@ -281,7 +302,7 @@ SDK와 WDK의 버전이 다르면 빌드가 실패할 가능성이 높으므로
281302
include(cmake/CPM.cmake)
282303
283304
set(CRTSYS_NTL_MAIN ON) # use ntl::main
284-
CPMAddPackage("gh:ntoskrnl7/[email protected].8")
305+
CPMAddPackage("gh:ntoskrnl7/[email protected].10")
285306
include(${crtsys_SOURCE_DIR}/cmake/CrtSys.cmake)
286307
287308
# add driver

include/.internal/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ Environment:
2626

2727
#define CRTSYS_VERSION_MAJOR 0
2828
#define CRTSYS_VERSION_MINOR 1
29-
#define CRTSYS_VERSION_PATCH 8
29+
#define CRTSYS_VERSION_PATCH 10
3030

3131
#endif // _CRTSYS_VERSION_

include/ntl/irql

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/**
2+
* @file irql
3+
* @author jungkwang.lee ([email protected])
4+
* @brief KIRQL Helper features.
5+
*
6+
* @copyright Copyright (c) 2022 NT Template Library Authoers.
7+
*
8+
*/
9+
10+
#ifndef _NTDDK_
11+
#include <wdm.h>
12+
#endif
13+
14+
namespace ntl {
15+
enum irql : KIRQL {
16+
passive = PASSIVE_LEVEL,
17+
low = passive,
18+
apc = APC_LEVEL,
19+
dispatch = DISPATCH_LEVEL,
20+
dpc = dispatch,
21+
#if defined(_X86_) || defined(_AMD64_)
22+
cmci = CMCI_LEVEL,
23+
#endif
24+
clock = CLOCK_LEVEL,
25+
ipi = IPI_LEVEL,
26+
#if !defined(_X86_)
27+
drs = DRS_LEVEL,
28+
#endif
29+
power = POWER_LEVEL,
30+
profile = PROFILE_LEVEL,
31+
#if defined(_X86_)
32+
clock1 = CLOCK1_LEVEL,
33+
clock2 = CLOCK2_LEVEL,
34+
#endif
35+
high = HIGH_LEVEL
36+
};
37+
38+
struct to_dpc_level_t {
39+
explicit to_dpc_level_t() = default;
40+
};
41+
42+
struct to_synch_level_t {
43+
explicit to_synch_level_t() = default;
44+
};
45+
46+
_INLINE_VAR constexpr to_dpc_level_t to_dpc_level{};
47+
_INLINE_VAR constexpr to_synch_level_t to_synch_level{};
48+
49+
class raised_irql {
50+
public:
51+
raised_irql(to_dpc_level_t) : old_irql_(KeRaiseIrqlToDpcLevel()) {}
52+
raised_irql(to_synch_level_t) : old_irql_(KeRaiseIrqlToSynchLevel()) {}
53+
raised_irql(irql irql) { KeRaiseIrql(static_cast<KIRQL>(irql), &old_irql_); }
54+
55+
~raised_irql() { KeLowerIrql(old_irql_); }
56+
57+
raised_irql(const raised_irql &) = delete;
58+
raised_irql &operator=(const raised_irql &) = delete;
59+
60+
irql old() const { return static_cast<irql>(old_irql_); }
61+
62+
private:
63+
KIRQL old_irql_;
64+
};
65+
66+
raised_irql raise_irql(KIRQL irql) {
67+
return raised_irql{static_cast<ntl::irql>(irql)};
68+
}
69+
70+
raised_irql raise_irql_to_dpc_level() { return raised_irql{to_dpc_level}; }
71+
72+
raised_irql raise_irql_to_synch_level() { return raised_irql{to_synch_level}; }
73+
74+
ntl::irql current_irql() { return static_cast<ntl::irql>(KeGetCurrentIrql()); }
75+
} // namespace ntl

0 commit comments

Comments
 (0)