//The function in the dll is where all I am doing is writing a value to that address:
BOOL test_sizeKey(unsigned short *sizeKey)
{
BOOL rc = TRUE;
*sizeKey = 150;
return rc;
}
My python program that loads the dll is as follows.:
import ctypes
my_dll = ctypes.WinDLL("C:/CFiles/test_dll/SimpleArg/x64/Debug/SimpleArg.dll")
USHORT = ctypes.c_ushort
func6 = my_dll.test_sizeKey
sizeKey = USHORT()
sizeKey = ctypes.byref(sizeKey)
func6.argtypes = [
ctypes.POINTER(USHORT) # sizeKey (pointer to USHORT)
]
func6.restype = ctypes.c_bool
success6 = func6(
sizeKey
)
print(sizeKey)
The output I am getting when I print the last variable is:
<cparam 'P' (0x0000020403CF8498)>