Skip to content

Fixed constant in winapi.py.#376

Merged
gorakhargosh merged 1 commit into
gorakhargosh:masterfrom
pierregr:master
Oct 6, 2016
Merged

Fixed constant in winapi.py.#376
gorakhargosh merged 1 commit into
gorakhargosh:masterfrom
pierregr:master

Conversation

@pierregr

Copy link
Copy Markdown
Contributor

Changed constant in winapi.py to

FILE_LIST_DIRECTORY = 1

from

FILE_LIST_DIRECTORY = 0x01

accordingly to kernel32.dll documentation after file not found errors in line 276

def get_directory_handle(path):
    """Returns a Windows handle to the specified directory path."""
    return CreateFileW(path, FILE_LIST_DIRECTORY, WATCHDOG_FILE_SHARE_FLAGS,
                       None, OPEN_EXISTING, WATCHDOG_FILE_FLAGS, None)

during watchdog startup on win2008 server.

Fixed winapi.py accordingly to kernel32.dll documentation. After file not found errors in line 276:

def get_directory_handle(path):
    """Returns a Windows handle to the specified directory path."""
    return CreateFileW(path, FILE_LIST_DIRECTORY, WATCHDOG_FILE_SHARE_FLAGS,
                       None, OPEN_EXISTING, WATCHDOG_FILE_FLAGS, None)

during watchdog startup on win2008 server.
@danilobellini

Copy link
Copy Markdown
Collaborator

But 0x01 is 1. That makes no difference at all.

@pierregr

pierregr commented Oct 3, 2016

Copy link
Copy Markdown
Contributor Author

It seems the kernel32.dll on win 2008 server running in VMWare disagrees on that. Could be the endianess. Let python handle it for you and everything is right.

@gorakhargosh

Copy link
Copy Markdown
Owner

LGTM.

@gorakhargosh
gorakhargosh merged commit 1e0d81e into gorakhargosh:master Oct 6, 2016
CCP-Aporia pushed a commit to CCP-Aporia/watchdog that referenced this pull request Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants