-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(job-attachments): remove dependency on pywin32 for submission code (
#250) Signed-off-by: Jericho Tolentino <68654047+jericht@users.noreply.github.com>
- Loading branch information
Showing
5 changed files
with
101 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
|
||
import ctypes | ||
import ctypes.wintypes | ||
import sys | ||
|
||
# This assertion short-circuits mypy from type checking this module on platforms other than Windows | ||
# https://mypy.readthedocs.io/en/stable/common_issues.html#python-version-and-system-platform-checks | ||
assert sys.platform == "win32" | ||
|
||
kernel32 = ctypes.WinDLL("Kernel32") | ||
|
||
# https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfinalpathnamebyhandlew | ||
kernel32.GetFinalPathNameByHandleW.restype = ctypes.wintypes.DWORD | ||
kernel32.GetFinalPathNameByHandleW.argtypes = [ | ||
ctypes.wintypes.HANDLE, # [in] HANDLE hFile, | ||
ctypes.wintypes.LPWSTR, # [out] LPWSTR lpszFilePath, | ||
ctypes.wintypes.DWORD, # [in] DWORD cchFilePath, | ||
ctypes.wintypes.DWORD, # [in] DWORD dwFlags | ||
] | ||
GetFinalPathNameByHandleW = kernel32.GetFinalPathNameByHandleW | ||
|
||
VOLUME_NAME_DOS = 0 | ||
VOLUME_NAME_GUID = 1 | ||
VOLUME_NAME_NONE = 4 | ||
VOLUME_NAME_NT = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters