-
-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Support] Windows Error 0xc0000002 Exception #644
Comments
I believe this issue is due to the behavior of If we can solve this problem, it could serve as a useful reference for troubleshooting when manually defining custom interfaces using I noticed that the program flow does not proceed after the I'm not entirely sure why the error occurs when |
It doesn't seems that 2b780b<POINTER(IDWriteFont) ptr=0x1d594494840 at 1d594344950>
This print is displayed
Before HasCharacter
After HasCharacter
Exception ignored in: <function _compointer_base.__del__ at 0x000001D592A854E0>
Traceback (most recent call last):
File "C:\Users\moi15moi\AppData\Local\Programs\Python\Python311\Lib\site-packages\comtypes\_post_coinit\unknwn.py", line 386, in __del__
self.Release()
File "C:\Users\moi15moi\AppData\Local\Programs\Python\Python311\Lib\site-packages\comtypes\_post_coinit\unknwn.py", line 534, in Release
return self.__com_Release() # type: ignore
^^^^^^^^^^^^^^^^^^^^
OSError: [WinError -1073741822] Windows Error 0xc0000002 Edit: Traceback (most recent call last):
File "C:\Users\moi15moi\Documents\GitHub\FindSystemFontsFilename\find_system_fonts_filename\windows\windows_fonts.py", line 344, in get_font_fallback
font.AddRef()
File "C:\Users\moi15moi\AppData\Local\Programs\Python\Python311\Lib\site-packages\comtypes\_post_coinit\unknwn.py", line 530, in AddRef
return self.__com_AddRef() # type: ignore
^^^^^^^^^^^^^^^^^^^
OSError: [WinError -1073741822] Windows Error 0xc0000002 |
I fixed the bug in this commit. I am surprised that I could call Now, I ensure the font is properly initialized by calling |
I am pretty sure it is a skill issue and comtypes may have nothing to do with my problem, but I can't find why I always get the exception.
From what I can see in the Microsoft documentation,
0xc0000002
isSTATUS_NOT_IMPLEMENTED
. I don't really understand why it happens.It occurs when I run this code with this PR (due to the high dependency across various parts of the code, creating a small, self-contained example is quite difficult):
If I add a
print(self)
here, it prints me<POINTER(IDWriteFont) ptr=0x2949ed64a50 at 2949e84c5d0>
.I'm wondering if it happens because here, I pass a pointer of my IDWriteFont that I use here.
Do you have any idea what I could do wrong?
My environment
Python version: 3.11.7
comtypes version: 1.4.8
The text was updated successfully, but these errors were encountered: