Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
docker-images
Commits
8b57621c
Commit
8b57621c
authored
Jun 20, 2016
by
Hugo Beauzée-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a new winstorecompat patch
parent
0dabb80f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
244 additions
and
0 deletions
+244
-0
vlc-winrt/toolchain-i686/Dockerfile
vlc-winrt/toolchain-i686/Dockerfile
+2
-0
vlc-winrt/toolchain-i686/winstorecompat.patch
vlc-winrt/toolchain-i686/winstorecompat.patch
+120
-0
vlc-winrt/toolchain-x86_64/Dockerfile
vlc-winrt/toolchain-x86_64/Dockerfile
+2
-0
vlc-winrt/toolchain-x86_64/winstorecompat.patch
vlc-winrt/toolchain-x86_64/winstorecompat.patch
+120
-0
No files found.
vlc-winrt/toolchain-i686/Dockerfile
View file @
8b57621c
...
...
@@ -13,6 +13,7 @@ ENV MINGW_PREFIX=$TOOLCHAIN_PREFIX/$TARGET_TUPLE
ENV
PATH=$TOOLCHAIN_PREFIX/bin:$PATH
COPY
missing-snprintf.patch .
COPY
winstorecompat.patch .
RUN
mkdir
/build
&&
cd
/build
&&
\
mkdir
$TOOLCHAIN_PREFIX
&&
\
...
...
@@ -51,6 +52,7 @@ RUN mkdir /build && cd /build && \
make install-gcc
&&
\
cd
/build/mingw-w64/mingw-w64-crt
&&
\
git am ../../../missing-snprintf.patch
&&
\
git am ../../../winstorecompat.patch
&&
\
mkdir
build
&&
cd
build
&&
\
../configure
--prefix
=
$MINGW_PREFIX
\
--host
=
$TARGET_TUPLE
&&
\
...
...
vlc-winrt/toolchain-i686/winstorecompat.patch
0 → 100644
View file @
8b57621c
From fac8ad8364470439dc4a726c01fc2a6f7272e97f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
Date: Mon, 20 Jun 2016 19:32:12 +0200
Subject: [PATCH] winstorecompat: Provide a GetFileInformationByHandle
replacement
---
mingw-w64-headers/include/fileapi.h | 6 +--
mingw-w64-libraries/winstorecompat/Makefile.am | 1 +
.../src/GetFileInformationByHandle.c | 57 ++++++++++++++++++++++
3 files changed, 61 insertions(+), 3 deletions(-)
create mode 100644 mingw-w64-libraries/winstorecompat/src/GetFileInformationByHandle.c
diff --git a/mingw-w64-headers/include/fileapi.h b/mingw-w64-headers/include/fileapi.h
index eb7ccc9..ab348f6 100755
--- a/mingw-w64-headers/include/fileapi.h
+++ b/mingw-w64-headers/include/fileapi.h
@@ -33,8 +33,6 @@
WINBASEAPI DWORD WINAPI GetFileAttributesW (LPCWSTR lpFileName);
#define GetFileAttributes __MINGW_NAME_AW(GetFileAttributes)
WINBASEAPI DWORD WINAPI GetFileSize (HANDLE hFile, LPDWORD lpFileSizeHigh);
WINBASEAPI DWORD WINAPI SetFilePointer (HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod);
-#endif
-#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
typedef struct _BY_HANDLE_FILE_INFORMATION {
DWORD dwFileAttributes;
FILETIME ftCreationTime;
@@ -48,6 +46,9 @@
WINBASEAPI DWORD WINAPI SetFilePointer (HANDLE hFile, LONG lDistanceToMove, PLON
DWORD nFileIndexLow;
} BY_HANDLE_FILE_INFORMATION, *PBY_HANDLE_FILE_INFORMATION,
*LPBY_HANDLE_FILE_INFORMATION;
+WINBASEAPI WINBOOL WINAPI GetFileInformationByHandle (HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation);
+#endif
+#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
WINBASEAPI LONG WINAPI CompareFileTime (CONST FILETIME *lpFileTime1, CONST FILETIME *lpFileTime2);
WINBASEAPI HANDLE WINAPI CreateFileA (LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);
@@ -68,7 +69,6 @@
WINBASEAPI DWORD WINAPI SetFilePointer (HANDLE hFile, LONG lDistanceToMove, PLON
WINBASEAPI UINT WINAPI GetDriveTypeA (LPCSTR lpRootPathName);
WINBASEAPI UINT WINAPI GetDriveTypeW (LPCWSTR lpRootPathName);
WINBASEAPI DWORD WINAPI GetFileAttributesA (LPCSTR lpFileName);
- WINBASEAPI WINBOOL WINAPI GetFileInformationByHandle (HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation);
WINBASEAPI WINBOOL WINAPI GetFileSizeEx (HANDLE hFile, PLARGE_INTEGER lpFileSize);
WINBASEAPI WINBOOL WINAPI GetFileTime (HANDLE hFile, LPFILETIME lpCreationTime, LPFILETIME lpLastAccessTime, LPFILETIME lpLastWriteTime);
WINBASEAPI DWORD WINAPI GetFileType (HANDLE hFile);
diff --git a/mingw-w64-libraries/winstorecompat/Makefile.am b/mingw-w64-libraries/winstorecompat/Makefile.am
index 332cae5..66de268 100644
--- a/mingw-w64-libraries/winstorecompat/Makefile.am
+++ b/mingw-w64-libraries/winstorecompat/Makefile.am
@@ -36,4 +36,5 @@
libwinstorecompat_a_SOURCES = \
src/SHGetFolderPathW.c \
src/QueueTimer.c \
src/Crypto.c \
+ src/GetFileInformationByHandle.c \
$(NULL)
diff --git a/mingw-w64-libraries/winstorecompat/src/GetFileInformationByHandle.c b/mingw-w64-libraries/winstorecompat/src/GetFileInformationByHandle.c
new file mode 100644
index 0000000..89f8256
--- /dev/null
+++ b/mingw-w64-libraries/winstorecompat/src/GetFileInformationByHandle.c
@@ -0,0 +1,57 @@
+/*
+ Copyright (c) 2016 mingw-w64 project
+
+ Contributing authors: Hugo Beauzée-Luyssen
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+*/
+
+#define _WIN32_WINNT 0x0A00
+
+#define GetFileInformationByHandle __GetFileInformationByHandle
+#include <windows.h>
+
+#undef GetFileInformationByHandle
+
+BOOL WINAPI GetFileInformationByHandle(HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation)
+{
+ FILE_BASIC_INFO basicInfo;
+ if (!GetFileInformationByHandleEx(hFile, FileBasicInfo, &basicInfo, sizeof(basicInfo)))
+ return FALSE;
+ lpFileInformation->dwFileAttributes = basicInfo.FileAttributes;
+ lpFileInformation->ftCreationTime.dwLowDateTime = basicInfo.CreationTime.LowPart;
+ lpFileInformation->ftCreationTime.dwHighDateTime = basicInfo.CreationTime.HighPart;
+ lpFileInformation->ftLastAccessTime.dwLowDateTime = basicInfo.LastAccessTime.LowPart;
+ lpFileInformation->ftLastAccessTime.dwHighDateTime = basicInfo.LastAccessTime.HighPart;
+ lpFileInformation->ftLastWriteTime.dwLowDateTime = basicInfo.ChangeTime.LowPart;
+ lpFileInformation->ftLastWriteTime.dwHighDateTime = basicInfo.ChangeTime.HighPart;
+
+ FILE_STANDARD_INFO standardInfo;
+ if (!GetFileInformationByHandleEx(hFile, FileStandardInfo, &standardInfo, sizeof(standardInfo)))
+ return FALSE;
+ lpFileInformation->nNumberOfLinks = standardInfo.NumberOfLinks;
+ lpFileInformation->nFileSizeLow = standardInfo.AllocationSize.LowPart;
+ lpFileInformation->nFileSizeHigh = standardInfo.AllocationSize.HighPart;
+
+ // Missing FileID & volume serial number
+ lpFileInformation->dwVolumeSerialNumber = 0;
+ lpFileInformation->nFileIndexHigh = 0;
+ lpFileInformation->nFileIndexLow = 0;
+ return TRUE;
+}
--
2.8.1
vlc-winrt/toolchain-x86_64/Dockerfile
View file @
8b57621c
...
...
@@ -14,6 +14,7 @@ ENV PATH=$TOOLCHAIN_PREFIX/bin:$PATH
COPY
no-rtl-func.patch .
COPY
missing-snprintf.patch .
COPY
winstorecompat.patch .
RUN
mkdir
/build
&&
cd
/build
&&
\
mkdir
$TOOLCHAIN_PREFIX
&&
\
...
...
@@ -26,6 +27,7 @@ RUN mkdir /build && cd /build && \
git clone
--depth
=
1 git://git.code.sf.net/p/mingw-w64/mingw-w64
&&
\
cd
mingw-w64
&&
git am ../../no-rtl-func.patch
&&
\
git am ../../missing-snprintf.patch
&&
\
git am ../../winstorecompat.patch
&&
\
cd
..
&&
\
tar
xf gcc-5.3.0.tar.bz2
&&
\
tar
xf binutils-2.26.tar.bz2
&&
\
...
...
vlc-winrt/toolchain-x86_64/winstorecompat.patch
0 → 100644
View file @
8b57621c
From fac8ad8364470439dc4a726c01fc2a6f7272e97f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
Date: Mon, 20 Jun 2016 19:32:12 +0200
Subject: [PATCH] winstorecompat: Provide a GetFileInformationByHandle
replacement
---
mingw-w64-headers/include/fileapi.h | 6 +--
mingw-w64-libraries/winstorecompat/Makefile.am | 1 +
.../src/GetFileInformationByHandle.c | 57 ++++++++++++++++++++++
3 files changed, 61 insertions(+), 3 deletions(-)
create mode 100644 mingw-w64-libraries/winstorecompat/src/GetFileInformationByHandle.c
diff --git a/mingw-w64-headers/include/fileapi.h b/mingw-w64-headers/include/fileapi.h
index eb7ccc9..ab348f6 100755
--- a/mingw-w64-headers/include/fileapi.h
+++ b/mingw-w64-headers/include/fileapi.h
@@ -33,8 +33,6 @@
WINBASEAPI DWORD WINAPI GetFileAttributesW (LPCWSTR lpFileName);
#define GetFileAttributes __MINGW_NAME_AW(GetFileAttributes)
WINBASEAPI DWORD WINAPI GetFileSize (HANDLE hFile, LPDWORD lpFileSizeHigh);
WINBASEAPI DWORD WINAPI SetFilePointer (HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod);
-#endif
-#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
typedef struct _BY_HANDLE_FILE_INFORMATION {
DWORD dwFileAttributes;
FILETIME ftCreationTime;
@@ -48,6 +46,9 @@
WINBASEAPI DWORD WINAPI SetFilePointer (HANDLE hFile, LONG lDistanceToMove, PLON
DWORD nFileIndexLow;
} BY_HANDLE_FILE_INFORMATION, *PBY_HANDLE_FILE_INFORMATION,
*LPBY_HANDLE_FILE_INFORMATION;
+WINBASEAPI WINBOOL WINAPI GetFileInformationByHandle (HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation);
+#endif
+#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
WINBASEAPI LONG WINAPI CompareFileTime (CONST FILETIME *lpFileTime1, CONST FILETIME *lpFileTime2);
WINBASEAPI HANDLE WINAPI CreateFileA (LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);
@@ -68,7 +69,6 @@
WINBASEAPI DWORD WINAPI SetFilePointer (HANDLE hFile, LONG lDistanceToMove, PLON
WINBASEAPI UINT WINAPI GetDriveTypeA (LPCSTR lpRootPathName);
WINBASEAPI UINT WINAPI GetDriveTypeW (LPCWSTR lpRootPathName);
WINBASEAPI DWORD WINAPI GetFileAttributesA (LPCSTR lpFileName);
- WINBASEAPI WINBOOL WINAPI GetFileInformationByHandle (HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation);
WINBASEAPI WINBOOL WINAPI GetFileSizeEx (HANDLE hFile, PLARGE_INTEGER lpFileSize);
WINBASEAPI WINBOOL WINAPI GetFileTime (HANDLE hFile, LPFILETIME lpCreationTime, LPFILETIME lpLastAccessTime, LPFILETIME lpLastWriteTime);
WINBASEAPI DWORD WINAPI GetFileType (HANDLE hFile);
diff --git a/mingw-w64-libraries/winstorecompat/Makefile.am b/mingw-w64-libraries/winstorecompat/Makefile.am
index 332cae5..66de268 100644
--- a/mingw-w64-libraries/winstorecompat/Makefile.am
+++ b/mingw-w64-libraries/winstorecompat/Makefile.am
@@ -36,4 +36,5 @@
libwinstorecompat_a_SOURCES = \
src/SHGetFolderPathW.c \
src/QueueTimer.c \
src/Crypto.c \
+ src/GetFileInformationByHandle.c \
$(NULL)
diff --git a/mingw-w64-libraries/winstorecompat/src/GetFileInformationByHandle.c b/mingw-w64-libraries/winstorecompat/src/GetFileInformationByHandle.c
new file mode 100644
index 0000000..89f8256
--- /dev/null
+++ b/mingw-w64-libraries/winstorecompat/src/GetFileInformationByHandle.c
@@ -0,0 +1,57 @@
+/*
+ Copyright (c) 2016 mingw-w64 project
+
+ Contributing authors: Hugo Beauzée-Luyssen
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+*/
+
+#define _WIN32_WINNT 0x0A00
+
+#define GetFileInformationByHandle __GetFileInformationByHandle
+#include <windows.h>
+
+#undef GetFileInformationByHandle
+
+BOOL WINAPI GetFileInformationByHandle(HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation)
+{
+ FILE_BASIC_INFO basicInfo;
+ if (!GetFileInformationByHandleEx(hFile, FileBasicInfo, &basicInfo, sizeof(basicInfo)))
+ return FALSE;
+ lpFileInformation->dwFileAttributes = basicInfo.FileAttributes;
+ lpFileInformation->ftCreationTime.dwLowDateTime = basicInfo.CreationTime.LowPart;
+ lpFileInformation->ftCreationTime.dwHighDateTime = basicInfo.CreationTime.HighPart;
+ lpFileInformation->ftLastAccessTime.dwLowDateTime = basicInfo.LastAccessTime.LowPart;
+ lpFileInformation->ftLastAccessTime.dwHighDateTime = basicInfo.LastAccessTime.HighPart;
+ lpFileInformation->ftLastWriteTime.dwLowDateTime = basicInfo.ChangeTime.LowPart;
+ lpFileInformation->ftLastWriteTime.dwHighDateTime = basicInfo.ChangeTime.HighPart;
+
+ FILE_STANDARD_INFO standardInfo;
+ if (!GetFileInformationByHandleEx(hFile, FileStandardInfo, &standardInfo, sizeof(standardInfo)))
+ return FALSE;
+ lpFileInformation->nNumberOfLinks = standardInfo.NumberOfLinks;
+ lpFileInformation->nFileSizeLow = standardInfo.AllocationSize.LowPart;
+ lpFileInformation->nFileSizeHigh = standardInfo.AllocationSize.HighPart;
+
+ // Missing FileID & volume serial number
+ lpFileInformation->dwVolumeSerialNumber = 0;
+ lpFileInformation->nFileIndexHigh = 0;
+ lpFileInformation->nFileIndexLow = 0;
+ return TRUE;
+}
--
2.8.1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment