Skip to content

Commit c579317

Browse files
committed
revise a few source files
1 parent 1234c0b commit c579317

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

onnxruntime/core/dll/delay_load_hook.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,13 @@ FARPROC WINAPI delay_load_hook(unsigned dliNotify, PDelayLoadInfo pdli) {
7777
}
7878

7979
path.resize(path.rfind(L'\\') + 1);
80+
81+
// Append the name of the DLL. Now `path` is the absolute path to the DLL to load.
8082
path.append(known_dlls[i].wstr);
8183

82-
return FARPROC(LoadLibraryExW(path.c_str(), NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR));
84+
// Load the DLL
85+
return FARPROC(LoadLibraryExW(path.c_str(), NULL,
86+
LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR));
8387
}
8488
}
8589
}

onnxruntime/core/providers/webgpu/dll_delay_load_helper.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ std::wstring GetCurrentDllDir() {
2525
GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
2626
reinterpret_cast<LPCWSTR>(&GetCurrentDllDir), &moduleHandle);
2727
if (moduleHandle == nullptr) {
28+
// Failed to get the handle of the current module. Returns an empty string.
2829
return std::wstring{};
2930
}
3031

onnxruntime/test/webgpu/delay_load/main.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// │ └── test.exe
2424
// └── onnxruntime_webgpu_delay_load_test.exe (this binary)
2525
//
26-
// This folder structure ensures no DLLs are in the same folder as the executable.
26+
// This folder structure ensures no DLLs are in the same folder as the executable (test.exe).
2727
//
2828
// 2. Launch the test binary from the root folder of the above structure.
2929
//
@@ -72,7 +72,7 @@ int prepare_main() {
7272
// copy the test binary to the root folder
7373
fs::copy_file(exe_full_path, root_folder / L"test.exe");
7474

75-
// run "onnxruntime_webgpu_delay_load_test.exe --test" from the test root folder
75+
// run "test.exe --test" from the test root folder
7676
fs::current_path(root_folder);
7777
return _wsystem(L"test.exe --test");
7878
}

0 commit comments

Comments
 (0)