這是標題
This is a source code - of course - a C++ hello world.
#include <iostream>
int main( int argc, char* argv[] )
{
std::cout << "Hello World" << std::endl;
return 0;
}
看起來還不錯,真希望有 native editor 版本 …
Written with StackEdit.
This is a source code - of course - a C++ hello world.
#include <iostream>
int main( int argc, char* argv[] )
{
std::cout << "Hello World" << std::endl;
return 0;
}
看起來還不錯,真希望有 native editor 版本 …
Written with StackEdit.
auto i{ 10 }; // i is a std::initializer_list<int>當初在 C++11 看到時,覺得的確不太直覺,但當時記性還行,索性就記得說:新語言特性(auto)喜歡跟新語言特性(initializer_list)一起。後來在 C++17 中修改了,
For direct list-initialization: 1. For a braced-init-list with only a single element, auto deduction will deduce from that entry; 2. For a braced-init-list with more than one element, auto deduction will be ill-formed.也就是說,C++17 後變成了: auto + direct initialization + braced-init-list 只能初始化單一一個變數。
auto i{ 10 }; // legal and i is a std::initialize_list<int> auto i{ 10, 11 }; // illegal岔題一下:auto + direct initialization + braced-init-list 沒辦法用在 C-style array 上,所以下面在 C++11 和 C++17 都是非法的。
auto array[]{ 10, 11 }; // illegal auto array2[ 2 ]{ 10, 11 }; // illegal但如果今天場景變成 auto + copy initialization + braced-init-list 那就總是會定義出一個 std::initialize_list<int> 變數了。
auto i = { 10 }; // legal and i is a std::initializer_list<int> auto array = { 10, 11 }; // legal and array is a std::initializer_list<int>哎,那這次要怎麼記得這件規則呢?顧名思義:等號右邊是 braced-init-list ,所以它原本就是 std::initialize_list<int> ,那既然是 copy initialization 。那就連型別也一起 copy 吧~真是太哲學了! 好吧,因為是哲學,所以有點不太科學:return value 可以視為一種 copy initialization ,但這情況下,是不能使用 auto 推導出 std::initialize_list<int> 的,因為 braced-init-list 不是一個 expression ,並不會產生一個 value [1] 。因此 return type 需要一個明確的型別來搭配,並用來呼叫 return type 的 constructor 的 ...
auto f() { return {1,2}; // ill-formed, {1,2} is not an expression }...
0: kd> bu module!func 0: kd> g Breakpoint 0's offset expression evaluation failed. Check for invalid symbols or bad syntax. WaitForEvent failed nt!DebugService2+0x6: fffff806`31805296 c3 ret 1: kd> k # Child-SP RetAddr Call Site 00 ffffde00`16226b68 fffff806`31771955 nt!DebugService2+0x6 01 ffffde00`16226b70 fffff806`317718e7 nt!DbgLoadImageSymbols+0x45 02 ffffde00`16226bc0 fffff806`31b558f1 nt!DbgLoadImageSymbolsUnicode+0x33 03 ffffde00`16226c00 fffff806`31b55423 nt!MiDriverLoadSucceeded+0x18d 04 ffffde00`16226ca0 fffff806`31b54c06 nt!MmLoadSystemImageEx+0x807 05 ffffde00`16226e40 fffff806`31b3800c nt!MmLoadSystemImage+0x26 06 ffffde00`16226e80 fffff806`31b36f22 nt!IopLoadDriver+0x23c 07 ffffde00`16227050 fffff806`31b36c32 nt!PipCallDriverAddDeviceQueryRoutine+0x1be 08 ffffde00`162270e0 fffff806`31b365f0 nt!PnpCallDriverQueryServiceHelper+0xda 09 ffffde00`16227190 fffff806`31b35d83 nt!PipCallDriverAddDevice+0x41c 0a ffffde00`16227350 fffff806`31b2fcc6 nt!PipProcessDevNodeTree+0x333 0b ffffde00`16227420 fffff806`3176efba nt!PiRestartDevice+0xba 0c ffffde00`16227470 fffff806`3168e5c5 nt!PnpDeviceActionWorker+0x46a 0d ffffde00`16227530 fffff806`317265f5 nt!ExpWorkerThread+0x105 0e ffffde00`162275d0 fffff806`318048d8 nt!PspSystemThreadStartup+0x55 0f ffffde00`16227620 00000000`00000000 nt!KiStartSystemThread+0x28 1: kd> bc * 1: kd> bu module!func Couldn't resolve error at 'vmodule!func'為什麼呢?此時不是使用 Set Unresolved Breakpoint 嗎?嗯嗯,Unresolved Breakpoint 也是有需要 resolve 的時候,剛好系統正在載入新 module ,而且符合 bu 指定的 module name ,那就會開始 resolve symbol name ,如果找不到一樣會跳出 Couldn't resolve error at 'vmodule!func' 了。
一般來說,MiniFilter 的 InstanceSetupCallback 會在 filter manager 把 minifilter attache 到 volume 後呼叫。如果沒有的話,可以檢查一下 minifilter 的 INF 是否把 instance fla...