IS_SetDllDirectoryA(*cstring),Bool,Pascal,Raw,Name('SetDllDirectoryA')
and I had to create a special lib file for it.
I will be changing it to
IS_SetDllDirectoryA(long),Bool,Pascal,Name('SetDllDirectoryA')
in due course in order to be able to pass a null address which may be like
IS_SetDllDirectoryA(<*cstring>),Bool,Pascal,Raw,Name(‘SetDllDirectoryA’)
but I will also need to look in the dissembler window to see if an address is passed for a null cstring variable or if a null is passed for the address re the post below to clarify.
At this stage I was only trying to pass a path to the api, I hadnt got as far as passing a null to cancel it.
I also meet this criteria
To compile an application that uses this function, define _WIN32_WINNT as 0x0502 or later
0x0502 = WinXP SP1 or later.
Edit
So using the Long works and passing an address in a long or simply a zero in a long aka a null works.
IS_SetDllDirectoryA(long),Bool,Pascal,Name('SetDllDirectoryA')
These module definitions below dont work, both give an access violation.
IS_SetDllDirectoryA(*cstring),Bool,Pascal,Raw,Name('SetDllDirectoryA')
IS_SetDllDirectoryA(<*cstring>),Bool,Pascal,Raw,Name('SetDllDirectoryA')
Looking at the assembler window, the cstring module definition method is sending (pushing) an address to the null cstring from the stack register ebx.
The long module definition is pushing a variable (loc:cstringaddress) which contains zero.
The api appears to want just a long in this case whether there is a value in the cstring or not.