Hi All,
In the following:
use NativeCall;
constant BYTE := uint8;
constant LPDWORD := uint64; # long pointer to a DWORD
constant LPSTR = CArray[BYTE]; # long pointer to a string
constant DWORD := uint32;
constant HANDLE = Pointer[void];
sub WTSOpenServerA(
#`{
https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsopenservera?redirectedfrom=MSDN
C++
HANDLE WTSOpenServerA(
[in] LPSTR pServerName
);
}
LPSTR $pServerName
)
is native("Wtsapi32.dll")
is symbol("WTSOpenServerA")
returns DWORD
{ * };
NativeCall is resolving the pointers automatically
for me. It is taking $pServerName, which is a
Long Pointer to String (LPSTR) and creating the
pointer for me. This is appreciated.
It also returns and resolves the value of “HANDLE”
which is a C Pointer DWORD..
Question 1: how do I tell NativeCall I actually
want the C Pointer of HANDLE back and not what
it resolves to?
Question 2: how do I give NativeCall a pointer
value and tell Native call I do not want it
resolved into another pointer?
Many thanks,
-T