Skip to content

Instantly share code, notes, and snippets.

@Ai-Himmel Ai-Himmel/reply.md Secret
Created Feb 20, 2019

Embed
What would you like to do?

foo.c

#include <stdio.h>
#include <stdio.h>
	__declspec(dllexport) void foo(char** str)
	{
		puts(*str);
	}

	__declspec(dllexport) void bar(char** ch)
	{
		putc(**ch,stdout);
	}
import ctypes
dll = ctypes.CDLL('./foo.dll')
test_str = ctypes.c_char_p('Hello World')
test_str_p = ctypes.pointer(test_str)
dll.foo(test_str_p)
test_char = ctypes.c_char('A')
test_char_p = ctypes.pointer(test_char)
test_char_pp = ctypes.pointer(test_char_p)
dll.bar(test_char_pp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.