Skip to content

Windows __stdcallยค

This example shows how to access the 32-bit Windows kernel32 library from 64-bit Python. Kernel32 is the 32-bit server and Kernel64 is the 64-bit client.

Create a Kernel64 client to communicate with the 32-bit kernel32 library

>>> from msl.examples.loadlib import Kernel64
>>> k = Kernel64()
>>> k.lib32_path
'C:\\Windows\\SysWOW64\\kernel32.dll'

Call the library to get the current date and time by populating the SYSTEMTIME structure, see Kernel64.get_local_time

>>> now = k.get_local_time()

You have access to the server's stdout and stderr streams when you shut down the server

>>> stdout, stderr = k.shutdown_server32()