File tree 1 file changed +10
-7
lines changed
cleo_plugins/MemoryOperations
1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -363,18 +363,21 @@ class MemoryOperations
363
363
static OpcodeResult __stdcall opcode_0AA2 (CLEO::CRunningScript* thread)
364
364
{
365
365
OPCODE_READ_PARAM_STRING (path);
366
+
367
+ HMODULE ptr = nullptr ;
366
368
367
- // get absolute path
368
- // in case of just filename let LoadLibrary resolve it itself
369
+ // resolve absolute path and try load
369
370
char buff[MAX_PATH];
370
- if (std::filesystem::path (path).has_parent_path ())
371
+ strncpy (buff, path, sizeof (buff));
372
+ CLEO_ResolvePath (thread, buff, sizeof (buff));
373
+ ptr = LoadLibrary (buff);
374
+
375
+ // in case of just filename let LoadLibrary resolve it itself
376
+ if (ptr == nullptr && !std::filesystem::path (path).has_parent_path ())
371
377
{
372
- strncpy (buff, path, sizeof (buff));
373
- CLEO_ResolvePath (thread, buff, sizeof (buff));
374
- path = buff;
378
+ ptr = LoadLibrary (path);
375
379
}
376
380
377
- auto ptr = LoadLibrary (path);
378
381
if (ptr != nullptr )
379
382
{
380
383
m_libraries.insert (ptr);
You can’t perform that action at this time.
0 commit comments