Python ctypes access violation due to invalid pointer

I have a dll and its header file that define quite a number of functions to access data in a special format. Following other solutions, I am able to get a basic start with ctypes that seems to work but as soon as I attempt to use a returned file pointer I receive the access violation so I suspect I am using the pointers incorrectly.

I’m following example code in C which lays out creating a new context, then opening the file, so I believe that part is ok. I just can’t seem to do anything with the returned file reference. I do get file returned as an int after calling sie_file_open whereas the documentation says that the errors from the library return null. I’ve got a bunch of different functions to use with the file pointer, but even the most basic sie_release fails.

Taking the advice from here to use classes to manage the pointers (there will be many more needed to access the data later), I have:

from ctypes import *

libsie = cdll.LoadLibrary('libsie.dll')

#Set the SIE context
class pt_sie_context(c_void_p):
    pass

libsie.sie_context_new.argtypes = None
libsie.sie_context_new.restype = pt_sie_context

context = libsie.sie_context_new()

#Open the SIE file
class pt_sie_file(c_void_p):
    pass

libsie.sie_file_open.argtypes = (pt_sie_context,c_char_p)
libsie.sie_file_open.restypes = pt_sie_file

fpath = 'H2.sie'
file = libsie.sie_file_open(context,fpath.encode('utf-8'))

libsie.sie_release.argtypes = (pt_sie_file)
libsie.sie_release.restypes = None

libsie.sie_release(file) #access violation here

And from the header file:

typedef void sie_Context;
typedef void sie_File;

SIE_DECLARE(sie_Context *) sie_context_new(void);
SIE_DECLARE(sie_File *) sie_file_open(void *context_object, const char *name);
SIE_DECLARE(void) sie_release(void *object);

I’m relatively new to this whole process as well as C in general so any thoughts would be much appreciated.