Winand

Untitled

Mar 30th, 2015
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.79 KB | None | 0 0
  1. class FSCRT_BSTR(Structure):
  2.     _fields_ = [("str", c_char_p),
  3.                 ("len", c_uint)]
  4.     def __init__(self, s=None):
  5.         if type(s) is str:
  6.             su8 = s.encode()
  7.             self.str, self.len = c_char_p(su8), c_uint(len(su8))
  8.         else:
  9.             self.str, self.len = cast(create_string_buffer(s), c_char_p), c_uint(s)
  10.     def text(self):
  11.         if self.str:
  12.             return self.str.decode()
  13.  
  14. test = FSCRT_BSTR(1024)
  15. #FS_RESULT FSPDF_TextObject_GetUnicodeString(FSCRT_PAGE page, FSPDF_PAGEOBJECT textObj, FSCRT_BSTR * unicodeStr )
  16. print(hdll.FSPDF_TextObject_GetUnicodeString(Page, obj, byref(test)))
  17.  
  18. ---------------
  19. print(hdll.FSPDF_TextObject_GetUnicodeString(Page, obj, byref(test)))
  20. OSError: exception: access violation reading 0x00000000019C2F68
Advertisement
Add Comment
Please, Sign In to add comment