LoadLibrary找不到ntoskrnl(LoadLibrary cannot find ntoskrnl)
我正在写一个小应用程序调用KeBugCheck并崩溃系统但LoadLibrary无法找到ntoskrnl.exe(我在调用GetLastError时得到126作为返回值)
这是我的代码:
void* fnc; HMODULE bcLib; bcLib = LoadLibrary((LPCWSTR)"ntoskrnl.exe"); fnc = (void*) GetProcAddress(bcLib, (LPCSTR)"KeBugCheck"); int(*KeBugCheck)(ULONG); KeBugCheck = (int(*)(ULONG))fnc; KeBugCheck(0x000000E2);
此外,在调试窗口中,我看到此错误:
app.exe中0x00000000处的第一次机会异常:0xC0000005:访问冲突执行位置0x00000000。
任何帮助都会非常受欢迎
I am writing a small app which calls KeBugCheck and crashes the system but LoadLibrary is unable to find ntoskrnl.exe (I get 126 as return value when calling GetLastError)
Here is my code:
void* fnc; HMODULE bcLib; bcLib = LoadLibrary((LPCWSTR)"ntoskrnl.exe"); fnc = (void*) GetProcAddress(bcLib, (LPCSTR)"KeBugCheck"); int(*KeBugCheck)(ULONG); KeBugCheck = (int(*)(ULONG))fnc; KeBugCheck(0x000000E2);
Also, in the debug window, I see this error:
First-chance exception at 0x00000000 in app.exe: 0xC0000005: Access violation executing location 0x00000000.
Any help will be very much appriciated
原文:https://stackoverflow.com/questions/18042390
最满意答案
无法将类解析为类型,因为该类未在您使用的jre中传递。 从我看到的,它定义为不包含在java.util包中( java 6 util , java 7 util )。
我看到Joda库中提供了Period类。 stackoveflow上有一个类似的主题 ,也许它对你有用。The class cannot be resolved to a type because the class is not delivered in the jre you are using. And from what I see, it is definetely not included in the java.util package (java 6 util, java 7 util).
I saw that a Period class is offered in the Joda library. There is a similar subject on stackoveflow, maybe it can be useful for you.
相关问答
更多-
我们应该能够在枚举中放置静态值... Period.ofDays(1) = daily, Period.ofWeeks(2) = bi-weekly等。持续时间单位=月,持续时间= 5(假设),然后Period.ofMonths(duration) 。 谢谢。 We should just be able to put static values in the enum...Period.ofDays(1) = daily, Period.ofWeeks(2) = bi-weekly, etc. Durat ...
-
无法将类解析为类型,因为该类未在您使用的jre中传递。 从我看到的,它定义为不包含在java.util包中( java 6 util , java 7 util )。 我看到Joda库中提供了Period类。 stackoveflow上有一个类似的主题 ,也许它对你有用。 The class cannot be resolved to a type because the class is not delivered in the jre you are using. And from what I see ...
-
我相信这是正确的结果。 如果你运行下面的测试,你将会看到getMonths()返回1.看来getDays没有获得总天数,而是获得剩余天数。 @Test public void testOneMonthPeriodDays() { Period p = Period.between(LocalDate.of(2017, 06, 01), LocalDate.of(2017, 07, 01)); assertEquals(0, p.getDays()); assertEquals(1, ...
-
如何在Java中将Period转换并附加到Period类的小时?(How to convert and append days into hours of Period Class in java?)[2024-03-17]
确保您使用的是org.joda.time包中的Period类,而不是java.time 。 以下示例可以帮助您。 import org.joda.time.Period; import org.joda.time.PeriodType; import org.joda.time.format.PeriodFormatter; import org.joda.time.format.PeriodFormatterBuilder; import java.util.Calendar; import java. ... -
我刚刚想到,问题可能是每个非重叠时段没有相同数量的观测值,因此无法轻易创建类似矩阵的结构。 使用类似的东西,并注意每个列表元素的长度不同: lapply(split(xts.data,"weeks"), f) 为了说明period.apply如何在每个句点返回多个列: period.apply(xts.data, endpoints(xts.data,"weeks"), range) period.apply(xts.data, endpoints(xts.data,"weeks"), colMeans) ...
-
我觉得我错过了一些明显的,应该有一个更简单的方法,是否有更简单的方法来找到两个日期之间的时间段,但不包括某些日期? 那么,计算日期至今范围内的银行假日数量相对容易: 按时间顺序对所有银行假期进行排序 使用二进制搜索来查找集合中开始日期的来源 使用二进制搜索来查找结束日期在集合中的位置 从另一个索引中减去一个索引,以查找该范围内的条目数 正如您现在所做的那样,使用Period.Between计算整个期间 从范围中的总天数中减去范围中的条目数 考虑到开始和/或结束日期可能是银行假日。 逐个错误的可能性很大,但是 ...
-
尝试使用DATE_FORMAT函数而不是使用MONTH和DAY。 请确认db中的日期是日期格式 Try DATE_FORMAT function instead of using MONTH and DAY. And please confirm that dates in db are in date format
-
你可以尝试使用Java 8; LocalDate start = LocalDate.of(2011, Month.DECEMBER, 19); LocalDate end = LocalDate.now(); while (!start.isAfter(end)) { System.out.println(start); start = start.plusYears(1); } } You can try like this using ...
-
比较NSDate + Period(Comparing NSDate + Period)[2024-02-27]
要检查开始日期和当前日期之间的差异是否为偶数天,请使用NSDateComponents : NSDate *startDate = ...; NSDate *currentDate = [NSDate date]; NSCalendar *cal = [NSCalendar currentCalendar]; NSDateComponents *diff = [cal components:NSDayCalendarUnit fromDate:startDate ... -
你可以使用pd.PeriodIndex()方法。 假设您有以下DF: In [517]: x Out[517]: str_col 0 1971q1 1 1971q2 2 1971q3 3 1971q4 4 1972q1 5 1972q2 6 1972q3 7 1972q4 In [518]: x.dtypes Out[518]: str_col object dtype: object 让我们创建一个新的“期间”列: In [519]: x['period'] = pd.Per ...