Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Illegal memory access from GetAlias()

May
12,949
172
I have a SHELLEX plugin with these lines.

Code:
                    //tty_yield(0);
                    pAlias = GetAlias(argv[i]);
                    Printf(L"OK\r\n");
                    sei.lpFile = (pAlias == nullptr) ? argv[i] : pAlias;

I get this (never seeing the "OK").

Code:
v:\> shellex favs:
TCC: (Sys) Invalid access to memory location.
 "SHELLEX"

v:\>

If I uncomment the tty-yield() line, it works as desired; i.e., GetAlias() resolves "favs:" and (later) ShellExecuteEx() opens it. A Printf() will work as well as tty_yield().

What's happening?
 
Funny ... SwitchToThread() also cures it, but SwitchToThead() returns FALSE, meaning no other thread was waiting. Sleep(0) works also.
 
Back
Top