修正了一些错误
This commit is contained in:
@@ -51,6 +51,9 @@ class File:
|
||||
self.is_append = False
|
||||
self._share_mode = share
|
||||
|
||||
stdio.printf("[FILE] __init__ filename=%s mode=%d share=%d\n", filename, mode, share)
|
||||
stdio.fflush(0)
|
||||
|
||||
access: ULONG = 0
|
||||
disposition: ULONG = w32.win32file.OPEN_EXISTING
|
||||
|
||||
@@ -97,12 +100,18 @@ class File:
|
||||
disposition = w32.win32file.OPEN_EXISTING
|
||||
self.can_read = True
|
||||
|
||||
stdio.printf("[FILE] before CreateFileA access=%d disp=%d share=%d\n", access, disposition, self._share_mode)
|
||||
stdio.fflush(0)
|
||||
self.handle = w32.win32file.CreateFileA(
|
||||
filename, access, self._share_mode,
|
||||
None, disposition, w32.win32file.FILE_ATTRIBUTE_NORMAL, None
|
||||
)
|
||||
stdio.printf("[FILE] after CreateFileA handle=%p\n", self.handle)
|
||||
stdio.fflush(0)
|
||||
|
||||
if self.handle == w32.win32base.INVALID_HANDLE_VALUE:
|
||||
stdio.printf("[FILE] FAIL: handle == INVALID_HANDLE_VALUE\n")
|
||||
stdio.fflush(0)
|
||||
self.closed = True
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user