[ros-diffs] [reactos] 01/01: README.md: Fix missing links

2017-10-08 Thread Alexander Shaposhnikov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=48b27145781d7a0b7fc2d6772ad8c767c1af598c

commit 48b27145781d7a0b7fc2d6772ad8c767c1af598c
Author: Alexander Shaposhnikov 
AuthorDate: Mon Oct 9 05:03:46 2017 +0300

README.md: Fix missing links
---
 README.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 8894fdb916..06d7906045 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
 https://reactos.org/wiki/images/0/02/ReactOS_logo.png;>
 
 
-[![license.badge]][license.link] [![ghcontrib.badge]]() [![ghstats.badge]]() 
[![commits.badge]]() [![coverity.badge]][coverity.link] 
+[![license.badge]][license.link] [![ghcontrib.badge]][ghcontrib.link] 
[![ghstats.badge]][ghstats.link] [![commits.badge]][commits.link] 
[![coverity.badge]][coverity.link] 
 
 ## Quick Links
 
@@ -98,6 +98,7 @@ There is also an obsolete [SVN archive 
repository](https://svn.reactos.org/svn/r
 [travis.link]:  https://travis-ci.org/reactos/reactos
 [appveyor.link]:https://ci.appveyor.com/project/AmineKhaldi/reactos
 [coverity.link]:https://scan.coverity.com/projects/205
+[commits.link]: https://github.com/reactos/reactos/commits/master
 [release.link]: 
https://sourceforge.net/projects/reactos/files/ReactOS/0.4.6
 [license.link]: https://spdx.org/licenses/GPL-2.0+.html
 [sfstats.link]: https://sourceforge.net/projects/reactos



[ros-diffs] [reactos] 01/01: README.md: Added badges

2017-10-08 Thread Alexander Shaposhnikov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7cffc6d5ce69ae02fe92e9644d5584931ab49d49

commit 7cffc6d5ce69ae02fe92e9644d5584931ab49d49
Author: Alexander Shaposhnikov 
AuthorDate: Mon Oct 9 03:07:40 2017 +0300

README.md: Added badges

Added various badges: CI, SourceForge, GitHub stats etc.
Centered image
Fixed some typos
---
 README.md | 67 ---
 1 file changed, 43 insertions(+), 24 deletions(-)

diff --git a/README.md b/README.md
index 80825631ca..8894fdb916 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,13 @@
-# ReactOS Project
+# ReactOS Project [![release.badge]][release.link] 
[![sfstats.badge]][sfstats.link] [![travis.badge]][travis.link] 
[![appveyor.badge]][appveyor.link]
 
-Current version: __0.4.6__
-![ReactOS Logo](https://reactos.org/wiki/images/0/02/ReactOS_logo.png)
+
+https://reactos.org/wiki/images/0/02/ReactOS_logo.png;>
+
+
+[![license.badge]][license.link] [![ghcontrib.badge]]() [![ghstats.badge]]() 
[![commits.badge]]() [![coverity.badge]][coverity.link] 
 
 ## Quick Links
+
 - [Website](https://reactos.org)
 - [Wiki](https://reactos.org/wiki)
 - [Forum](https://reactos.org/forum)
@@ -13,27 +17,22 @@ Current version: __0.4.6__
 
 ## What is ReactOS?
 
-ReactOS™ is an Open Source effort to develop a quality operating system that is
-compatible with applications and drivers written for the Microsoft® Windows™ NT
-family of operating systems (NT4, 2000, XP, 2003, Vista, Seven).
+ReactOS™ is an Open Source effort to develop a quality operating system that 
is compatible with applications and drivers written for the Microsoft® Windows™ 
NT family of operating systems (NT4, 2000, XP, 2003, Vista, Seven).
 
-The ReactOS project, although currently focused on Windows Server 2003
-compatibility, is always keeping an eye toward compatibility with
-Windows Vista and future Windows NT releases.
+The ReactOS project, although currently focused on Windows Server 2003 
compatibility, is always keeping an eye toward compatibility with Windows Vista 
and future Windows NT releases.
 
 The code of ReactOS is licensed under [GNU GPL 
2.0+](https://spdx.org/licenses/GPL-2.0+.html).
 
-## Building
+## Building [![rosbewin.badge]][rosbewin.link] 
[![rosbeunix.badge]][rosbeunix.link]
 
-To build the system it is strongly advised to use the _ReactOS Build 
Environment
-(RosBE)._ Up-to-date versions for Windows and for Unix/GNU-Linux are available
-from our download page at: http://www.reactos.org/wiki/Build_Environment
+To build the system it is strongly advised to use the _ReactOS Build 
Environment (RosBE)._
+Up-to-date versions for Windows and for Unix/GNU-Linux are available from our 
download page at: http://www.reactos.org/wiki/Build_Environment.
 
-Alternatively one can use Microsoft Visual C++ (MSVC) version 2010+. Building 
with MSVC is covered here: https://www.reactos.org/wiki/Building_with_MSVC
+Alternatively one can use Microsoft Visual C++ (MSVC) version 2010+. Building 
with MSVC is covered here: https://www.reactos.org/wiki/Building_with_MSVC.
 
 ### Binaries
 
-To build ReactOS you must use run `configure` script in the directory you want 
to have builds. Choose `configure.cmd` or `configure.sh` depending on your 
system. Then run `ninja ` to build a module you want or just 
`ninja` to build all modules.
+To build ReactOS you must run the `configure` script in the directory you want 
to have your build files. Choose `configure.cmd` or `configure.sh` depending on 
your system. Then run `ninja ` to build a module you want or just 
`ninja` to build all modules.
 
 ### Bootable images
 
@@ -44,14 +43,11 @@ See ["Building 
ReactOS"](http://www.reactos.org/wiki/Building_ReactOS) for more
 
 ## Installing
 
-ReactOS can only be installed on a machine that has a FAT16 or FAT32 partition
-as the active (bootable) partition. The partition on which ReactOS is to be
-installed (which may or may not be the bootable partition) must also be
-formatted as FAT16 or FAT32. ReactOS Setup can format the partitions if
-needed.
+ReactOS currently can only be installed on a machine that has a FAT16 or FAT32 
partition as the active (bootable) partition. 
+The partition on which ReactOS is to be installed (which may or may not be the 
bootable partition) must also be formatted as FAT16 or FAT32. 
+ReactOS Setup can format the partitions if needed.
 
-To install ReactOS from the bootable CD distribution, extract the archive
-contents. Then burn the CD image, boot from it, and follow instructions.
+To install ReactOS from the bootable CD distribution, extract the archive 
contents. Then burn the CD image, boot from it, and follow the instructions.
 
 See ["Installing ReactOS"](https://www.reactos.org/wiki/Installing_ReactOS) 
Wiki page or [INSTALL](INSTALL) for more details.
 
@@ -74,15 +70,38 @@ ReactOS is also not "yet another OS". It does not attempt 
to be a third player l
 
 More information is 

[ros-diffs] [reactos] 01/01: CORE-13875 Added russian translation for timeout util

2017-10-08 Thread Sergey Stopkin
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c8d97709cbbfc727ccf48d799202243804c25229

commit c8d97709cbbfc727ccf48d799202243804c25229
Author: Sergey Stopkin 
AuthorDate: Sun Oct 8 16:15:39 2017 +0600

CORE-13875 Added russian translation for timeout util
---
 base/applications/cmdutils/timeout/lang/ru-RU.rc | 34 
 base/applications/cmdutils/timeout/timeout.rc|  3 +++
 2 files changed, 37 insertions(+)

diff --git a/base/applications/cmdutils/timeout/lang/ru-RU.rc 
b/base/applications/cmdutils/timeout/lang/ru-RU.rc
new file mode 100644
index 00..ae69579d37
--- /dev/null
+++ b/base/applications/cmdutils/timeout/lang/ru-RU.rc
@@ -0,0 +1,34 @@
+LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
+
+STRINGTABLE
+BEGIN
+IDS_USAGE "ReactOS Timeout Utility\n\
+\n\
+TIMEOUT [/?] [/T] таймаут [/NOBREAK]\n\
+\n\
+Описание:\n\
+Команда позволяет организовать режим ожидания фиксированного интервала\n\
+времени, в секундах, либо интервала до нажатия клавиши на клавиатуре.\n\
+\n\
+Синтаксис:\n\
+/?  Показать эту справку.\n\
+\n\
+/T таймаут  Время ожидания в секундах.\n\
+Допустимый интервал: от -1 до 9 секунд.\n\
+Значение таймаута, равное -1 задает неограниченное время\n\
+ожидания до нажатия клавиши.\n\
+Ключ ""/T"" не является обязательным. Допускается указание\n\
+значения таймера без указания ключа.\n\
+\n\
+/NOBREAKИгнорировать нажатия клавиш, кроме сочетания Ctrl+C.\n\
+"
+IDS_ERROR_OUT_OF_RANGE "Ошибка: Значение таймера должно находиться в 
пределах диапазона (от -1 до 9).\n"
+IDS_ERROR_INVALID_HANDLE_VALUE "Ошибка: Не удалось получить стандартный 
дескриптор консоли (ошибка %lu).\n"
+IDS_ERROR_READ_INPUT "Ошибка: Невозможно прочитать консольный ввод (ошибка 
%lu).\n"
+IDS_ERROR_NO_TIMER_VALUE "Ошибка: Значение таймера должно быть указано (от 
-1 до 9).\n"
+IDS_ERROR_ONE_TIME "Ошибка: Требуется только одно значение таймера.\n"
+IDS_NOBREAK_INPUT "Нажмите Ctrl+C для выхода..."
+IDS_USER_INPUT "Нажмите любую клавишу для продолжения..."
+IDS_NOBREAK_INPUT_COUNT "Время ожидания %d секунд, нажмите Ctrl+C для 
выхода..."
+IDS_USER_INPUT_COUNT "Время ожидания %d секунд, нажмите любую клавишу для 
продолжения..."
+END
diff --git a/base/applications/cmdutils/timeout/timeout.rc 
b/base/applications/cmdutils/timeout/timeout.rc
index 80643a1eab..e5156b41b1 100644
--- a/base/applications/cmdutils/timeout/timeout.rc
+++ b/base/applications/cmdutils/timeout/timeout.rc
@@ -22,3 +22,6 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
 #ifdef LANGUAGE_IT_IT
 #include "lang/it-IT.rc"
 #endif
+#ifdef LANGUAGE_RU_RU
+#include "lang/ru-RU.rc"
+#endif



[ros-diffs] [reactos] 03/03: [NDK] Improve NDK tests for KTHREAD and add them to build

2017-10-08 Thread Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c22817db06a46bcd2012faeed35a14a236b27bd2

commit c22817db06a46bcd2012faeed35a14a236b27bd2
Author: Timo Kreuzer 
AuthorDate: Wed Aug 16 08:41:41 2017 +0200

[NDK] Improve NDK tests for KTHREAD and add them to build
---
 CMakeLists.txt   |   1 +
 sdk/include/ndk/tests/CMakeLists.txt |   2 +
 sdk/include/ndk/tests/win10_x64.c| 137 +
 sdk/include/ndk/tests/win10_x86.c| 128 ---
 sdk/include/ndk/tests/win2003_x64.c  |  57 +++---
 sdk/include/ndk/tests/win2003_x86.c  |  32 
 sdk/include/ndk/tests/win7_x64.c |  43 ++-
 sdk/include/ndk/tests/win7_x86.c |  36 -
 sdk/include/ndk/tests/win81_x64.c| 144 ---
 sdk/include/ndk/tests/win81_x86.c| 129 +--
 sdk/include/ndk/tests/win8_x64.c |  78 ++-
 sdk/include/ndk/tests/win8_x86.c |  18 +++--
 sdk/include/ndk/tests/winvista_x64.c |  56 +++---
 sdk/include/ndk/tests/winvista_x86.c |  62 +++
 14 files changed, 489 insertions(+), 434 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e7e0d9bd2f..f4c38c85f8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -250,6 +250,7 @@ else()
 
 add_dependency_header()
 
+add_subdirectory(sdk/include/ndk/tests)
 add_subdirectory(sdk/include/xdk)
 add_subdirectory(sdk/include/psdk)
 add_subdirectory(sdk/include/dxsdk)
diff --git a/sdk/include/ndk/tests/CMakeLists.txt 
b/sdk/include/ndk/tests/CMakeLists.txt
index df01c65517..a72c95f037 100644
--- a/sdk/include/ndk/tests/CMakeLists.txt
+++ b/sdk/include/ndk/tests/CMakeLists.txt
@@ -16,3 +16,5 @@ add_library(ndk_tests
 win81_x86.c
 win10_x86.c)
 endif()
+
+add_dependencies(ndk_tests xdk psdk bugcodes)
diff --git a/sdk/include/ndk/tests/win10_x64.c 
b/sdk/include/ndk/tests/win10_x64.c
index 5d326642ef..1ccde8ce99 100644
--- a/sdk/include/ndk/tests/win10_x64.c
+++ b/sdk/include/ndk/tests/win10_x64.c
@@ -7,113 +7,116 @@
 #include 
 #include 
 
-#define C_ASSERT_FIELD(Type, Offset, MemberType, MemberName) 
C_ASSERT(FIELD_OFFSET(Type, MemberName) == Offset);
+#define C_ASSERT_FIELD(Type, Offset, MemberType, MemberName) \
+C_ASSERT(FIELD_OFFSET(Type, MemberName) == Offset); \
+C_ASSERT(FIELD_SIZE(Type, MemberName) == sizeof(MemberType));
 
 /* KTHREAD */
 C_ASSERT_FIELD(KTHREAD, 0x000, DISPATCHER_HEADER, Header)
 C_ASSERT_FIELD(KTHREAD, 0x018, PVOID, SListFaultAddress)
-C_ASSERT_FIELD(KTHREAD, 0x020, UINT64, QuantumTarget)
+C_ASSERT_FIELD(KTHREAD, 0x020, ULONG64, QuantumTarget)
 C_ASSERT_FIELD(KTHREAD, 0x028, PVOID, InitialStack)
 C_ASSERT_FIELD(KTHREAD, 0x030, PVOID, StackLimit)
 C_ASSERT_FIELD(KTHREAD, 0x038, PVOID, StackBase)
-C_ASSERT_FIELD(KTHREAD, 0x040, UINT64, ThreadLock)
-C_ASSERT_FIELD(KTHREAD, 0x048, UINT64, CycleTime)
-C_ASSERT_FIELD(KTHREAD, 0x050, ULONG32, CurrentRunTime)
-C_ASSERT_FIELD(KTHREAD, 0x054, ULONG32, ExpectedRunTime)
+C_ASSERT_FIELD(KTHREAD, 0x040, ULONG64, ThreadLock)
+C_ASSERT_FIELD(KTHREAD, 0x048, ULONG64, CycleTime)
+C_ASSERT_FIELD(KTHREAD, 0x050, ULONG, CurrentRunTime)
+C_ASSERT_FIELD(KTHREAD, 0x054, ULONG, ExpectedRunTime)
 C_ASSERT_FIELD(KTHREAD, 0x058, PVOID, KernelStack)
-C_ASSERT_FIELD(KTHREAD, 0x060, XSAVE_FORMAT*, StateSaveArea)
-C_ASSERT_FIELD(KTHREAD, 0x068, KSCHEDULING_GROUP*, SchedulingGroup)
+C_ASSERT_FIELD(KTHREAD, 0x060, PXSAVE_FORMAT, StateSaveArea)
+C_ASSERT_FIELD(KTHREAD, 0x068, struct _KSCHEDULING_GROUP*, SchedulingGroup)
 C_ASSERT_FIELD(KTHREAD, 0x070, KWAIT_STATUS_REGISTER, WaitRegister)
-C_ASSERT_FIELD(KTHREAD, 0x071, UINT8, Running)
+C_ASSERT_FIELD(KTHREAD, 0x071, UCHAR, Running)
 C_ASSERT_FIELD(KTHREAD, 0x072, UINT8[2], Alerted)
-C_ASSERT_FIELD(KTHREAD, 0x074, LONG32, MiscFlags)
-C_ASSERT_FIELD(KTHREAD, 0x078, LONG32, ThreadFlags)
-C_ASSERT_FIELD(KTHREAD, 0x07C, UINT8, Tag)
-C_ASSERT_FIELD(KTHREAD, 0x07D, UINT8, SystemHeteroCpuPolicy)
-C_ASSERT_FIELD(KTHREAD, 0x080, ULONG32, SystemCallNumber)
+C_ASSERT_FIELD(KTHREAD, 0x074, LONG, MiscFlags)
+C_ASSERT_FIELD(KTHREAD, 0x078, LONG, ThreadFlags)
+C_ASSERT_FIELD(KTHREAD, 0x07C, UCHAR, Tag)
+C_ASSERT_FIELD(KTHREAD, 0x07D, UCHAR, SystemHeteroCpuPolicy)
+C_ASSERT_FIELD(KTHREAD, 0x080, ULONG, SystemCallNumber)
+C_ASSERT_FIELD(KTHREAD, 0x084, ULONG, Spare1)
 C_ASSERT_FIELD(KTHREAD, 0x088, PVOID, FirstArgument)
-C_ASSERT_FIELD(KTHREAD, 0x090, KTRAP_FRAME*, TrapFrame)
+C_ASSERT_FIELD(KTHREAD, 0x090, PKTRAP_FRAME, TrapFrame)
 C_ASSERT_FIELD(KTHREAD, 0x098, KAPC_STATE, ApcState)
 C_ASSERT_FIELD(KTHREAD, 0x0C3, CHAR, Priority)
-C_ASSERT_FIELD(KTHREAD, 0x0C4, ULONG32, UserIdealProcessor)
-C_ASSERT_FIELD(KTHREAD, 0x0C8, INT64, WaitStatus)
-C_ASSERT_FIELD(KTHREAD, 0x0D0, KWAIT_BLOCK*, WaitBlockList)
+C_ASSERT_FIELD(KTHREAD, 0x0C4, ULONG, UserIdealProcessor)
+C_ASSERT_FIELD(KTHREAD, 0x0C8, LONG64, WaitStatus)
+C_ASSERT_FIELD(KTHREAD, 0x0D0, PKWAIT_BLOCK, 

[ros-diffs] [reactos] 01/01: ru calculator translation update

2017-10-08 Thread Victor Kukshiev
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2ece6171c0151da802b195cfea638f19415aae50

commit 2ece6171c0151da802b195cfea638f19415aae50
Author: Victor Kukshiev 
AuthorDate: Sat Oct 7 23:02:57 2017 +0300

ru calculator translation update
---
 base/applications/calc/lang/ru-RU.rc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/base/applications/calc/lang/ru-RU.rc 
b/base/applications/calc/lang/ru-RU.rc
index a9d0036114..626d645f68 100644
--- a/base/applications/calc/lang/ru-RU.rc
+++ b/base/applications/calc/lang/ru-RU.rc
@@ -491,15 +491,15 @@ BEGIN
 IDS_CURRENCY_CZECH_KORUNA "Чешская крона"
 IDS_CURRENCY_DEUTSCHE_MARK "Немецкая марка"
 IDS_CURRENCY_DUTCH_GUILDER "Голландский гульден"
-IDS_CURRENCY_ESTONIAN_KROON "Estonian kroon"
+IDS_CURRENCY_ESTONIAN_KROON "Эстонская крона"
 IDS_CURRENCY_EURO "Евро"
 IDS_CURRENCY_FINNISH_MARKKA "Финская марка"
 IDS_CURRENCY_FRENCH_FRANC "Французский франк"
 IDS_CURRENCY_GREEK_DRACHMA "Греческая драхма"
 IDS_CURRENCY_IRISH_POUND "Ирландский фунт"
 IDS_CURRENCY_ITALIAN_LIRA "Итальянская лира"
-IDS_CURRENCY_LATVIAN_LATS "Latvian lats"
-IDS_CURRENCY_LITHUANIAN_LITAS "Lithuanian litas"
+IDS_CURRENCY_LATVIAN_LATS "Латвийский лат"
+IDS_CURRENCY_LITHUANIAN_LITAS "Литовский лит"
 IDS_CURRENCY_LUXEMBOURG_FRANC "Люксембургский франк"
 IDS_CURRENCY_MALTESE_LIRA "Мальтийская лира"
 IDS_CURRENCY_PORTOGUESE_ESCUDO "Португальское эскудо"



[ros-diffs] [reactos] 02/03: [NDK] Add Win8+ version of KTHREAD

2017-10-08 Thread Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b8bd38c86046f0d67bd8c45870e48c2196e6ccad

commit b8bd38c86046f0d67bd8c45870e48c2196e6ccad
Author: Timo Kreuzer 
AuthorDate: Wed Aug 16 08:33:44 2017 +0200

[NDK] Add Win8+ version of KTHREAD
---
 sdk/include/ndk/ketypes.h | 598 +-
 1 file changed, 596 insertions(+), 2 deletions(-)

diff --git a/sdk/include/ndk/ketypes.h b/sdk/include/ndk/ketypes.h
index 07e9feb946..7963217d8b 100644
--- a/sdk/include/ndk/ketypes.h
+++ b/sdk/include/ndk/ketypes.h
@@ -919,9 +919,178 @@ typedef struct _KTHREAD_COUNTERS
 }KTHREAD_COUNTERS, *PKTHREAD_COUNTERS;
 #endif
 
+/// FIXME: should move to rtltypes.h, but we can't include it here.
+#if (NTDDI_VERSION >= NTDDI_WIN8)
+typedef struct _RTL_RB_TREE
+{
+PRTL_BALANCED_NODE Root;
+PRTL_BALANCED_NODE Min;
+} RTL_RB_TREE, *PRTL_RB_TREE;
+#endif
+
+#if (NTDDI_VERSION >= NTDDI_WINBLUE)
+typedef struct _KLOCK_ENTRY_LOCK_STATE
+{
+union
+{
+struct
+{
+#if (NTDDI_VERSION >= NTDDI_WIN10) // since 6.4.9841.0
+ULONG_PTR CrossThreadReleasable : 1;
+#else
+ULONG_PTR Waiting : 1;
+#endif
+ULONG_PTR Busy : 1;
+ULONG_PTR Reserved : (8 * sizeof(PVOID)) - 3; // previously Spare
+ULONG_PTR InTree : 1;
+};
+PVOID LockState;
+};
+union
+{
+PVOID SessionState;
+struct
+{
+ULONG SessionId;
+#ifdef _WIN64
+ULONG SessionPad;
+#endif
+};
+};
+} KLOCK_ENTRY_LOCK_STATE, *PKLOCK_ENTRY_LOCK_STATE;
+
+typedef struct _KLOCK_ENTRY
+{
+union
+{
+RTL_BALANCED_NODE TreeNode;
+SINGLE_LIST_ENTRY FreeListEntry;
+};
+#if (NTDDI_VERSION >= NTDDI_WIN10)
+union
+{
+ULONG EntryFlags;
+struct
+{
+UCHAR EntryOffset;
+union
+{
+UCHAR ThreadLocalFlags;
+struct
+{
+UCHAR WaitingBit : 1;
+UCHAR Spare0 : 7;
+};
+};
+union
+{
+UCHAR AcquiredByte;
+UCHAR AcquiredBit : 1;
+};
+union
+{
+UCHAR CrossThreadFlags;
+struct
+{
+UCHAR HeadNodeBit : 1;
+UCHAR IoPriorityBit : 1;
+UCHAR IoQoSWaiter : 1; // since TH2
+UCHAR Spare1 : 5;
+};
+};
+};
+struct
+{
+ULONG StaticState : 8;
+ULONG AllFlags : 24;
+};
+};
+#ifdef _WIN64
+ULONG SpareFlags;
+#endif
+#else
+union
+{
+PVOID ThreadUnsafe;
+struct
+{
+volatile UCHAR HeadNodeByte;
+UCHAR Reserved1[2];
+volatile UCHAR AcquiredByte;
+};
+};
+#endif
+
+union
+{
+KLOCK_ENTRY_LOCK_STATE LockState;
+PVOID LockUnsafe;
+struct
+{
+#if (NTDDI_VERSION >= NTDDI_WIN10)
+volatile UCHAR CrossThreadReleasableAndBusyByte;
+#else
+volatile UCHAR WaitingAndBusyByte;
+#endif
+UCHAR Reserved[sizeof(PVOID) - 2];
+UCHAR InTreeByte;
+union
+{
+PVOID SessionState;
+struct
+{
+ULONG SessionId;
+#ifdef _WIN64
+ULONG SessionPad;
+#endif
+};
+};
+};
+};
+union
+{
+struct
+{
+RTL_RB_TREE OwnerTree;
+RTL_RB_TREE WaiterTree;
+};
+CHAR CpuPriorityKey;
+};
+ULONG_PTR EntryLock;
+union
+{
+#if _WIN64
+ULONG AllBoosts : 17;
+#else
+USHORT AllBoosts;
+#endif
+struct
+{
+struct
+{
+USHORT CpuBoostsBitmap : 15;
+USHORT IoBoost : 1;
+};
+struct
+{
+USHORT IoQoSBoost : 1;
+USHORT IoNormalPriorityWaiterCount : 8;
+USHORT IoQoSWaiterCount : 7;
+};
+};
+};
+#if _WIN64
+ULONG SparePad;
+#endif
+} KLOCK_ENTRY, *PKLOCK_ENTRY;
+
+#endif
+
 //
 // Kernel Thread (KTHREAD)
 //
+#if (NTDDI_VERSION < NTDDI_WIN8)
+
 typedef struct _KTHREAD
 {
 DISPATCHER_HEADER Header;
@@ -1131,7 +1300,7 @@ typedef struct _KTHREAD
 UCHAR LargeStack;
 };
 #endif // ]
-#ifdef _M_AMD64 // [
+#ifdef _WIN64 // [
 struct
 {
 UCHAR WaitBlockFill4[FIELD_OFFSET(KWAIT_BLOCK, SpareLong)];
@@ -1181,7 +1350,7 @@ typedef struct _KTHREAD
 PKTRAP_FRAME TrapFrame;
 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
 PVOID FirstArgument;
-union   // 2 elements, 0x8 
bytes (sizeof)
+  

[ros-diffs] [reactos] 01/03: [XDK] Fix KWAIT_BLOCK definition for Win8+

2017-10-08 Thread Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d176ddedd6fb165cb8a954d0069df0274aec2871

commit d176ddedd6fb165cb8a954d0069df0274aec2871
Author: Timo Kreuzer 
AuthorDate: Wed Aug 16 08:34:47 2017 +0200

[XDK] Fix KWAIT_BLOCK definition for Win8+
---
 sdk/include/xdk/ketypes.h | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/sdk/include/xdk/ketypes.h b/sdk/include/xdk/ketypes.h
index 710fd70e0e..5e276c08c7 100644
--- a/sdk/include/xdk/ketypes.h
+++ b/sdk/include/xdk/ketypes.h
@@ -442,6 +442,20 @@ typedef enum _KWAIT_REASON {
 
 typedef struct _KWAIT_BLOCK {
   LIST_ENTRY WaitListEntry;
+#if (NTDDI_VERSION >= NTDDI_WIN8)
+  UCHAR WaitType;
+  volatile UCHAR BlockState;
+  USHORT WaitKey;
+#ifdef _WIN64
+  LONG SpareLong;
+#endif
+  union {
+struct _KTHREAD *Thread;
+struct _KQUEUE *NotificationQueue;
+  };
+  PVOID Object;
+  PVOID SparePtr;
+#else
   struct _KTHREAD *Thread;
   PVOID Object;
   struct _KWAIT_BLOCK *NextWaitBlock;
@@ -455,6 +469,7 @@ typedef struct _KWAIT_BLOCK {
 #if defined(_WIN64)
   LONG SpareLong;
 #endif
+#endif
 } KWAIT_BLOCK, *PKWAIT_BLOCK, *PRKWAIT_BLOCK;
 
 typedef enum _KINTERRUPT_MODE {



[ros-diffs] [reactos] 01/01: [TRAVIS-CI] Fix formatting and move "./RosBEBinFull/RosBE.sh < tmp_file" to script for better 'Job Log' readability.

2017-10-08 Thread Adam Stachowicz
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8b8108ddeefd84d527a43f3eabab4a0134638636

commit 8b8108ddeefd84d527a43f3eabab4a0134638636
Author: Adam Stachowicz 
AuthorDate: Sun Oct 8 15:54:43 2017 +0200

[TRAVIS-CI] Fix formatting and move "./RosBEBinFull/RosBE.sh < tmp_file" to 
script for better 'Job Log' readability.
---
 .travis.yml | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 643416724e..bf63e00393 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,7 +4,9 @@ git:
   depth: 1
 
 before_script:
-- wget https://svn.reactos.org/amine/RosBEBinFull.tar.gz -O RosBE.tar.gz
-- tar -xzf RosBE.tar.gz
-- echo 'mkdir ../Build && cd ../Build && $TRAVIS_BUILD_DIR/configure.sh 
-DENABLE_ROSTESTS=1 && cd reactos && ninja && ninja bootcd' > tmp_file
-- ./RosBEBinFull/RosBE.sh < tmp_file
\ No newline at end of file
+  - wget https://svn.reactos.org/amine/RosBEBinFull.tar.gz -O RosBE.tar.gz
+  - tar -xzf RosBE.tar.gz
+  - echo 'mkdir ../Build && cd ../Build && $TRAVIS_BUILD_DIR/configure.sh 
-DENABLE_ROSTESTS=1 && cd reactos && ninja && ninja bootcd' > tmp_file
+
+script:
+  - ./RosBEBinFull/RosBE.sh < tmp_file



[ros-diffs] [reactos] 01/02: Add a small descriptive comment for the reason why the chosen files are specified in a .gitattributes file.

2017-10-08 Thread Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0436a4c73b22d9cce390504c5225ceaae8731854

commit 0436a4c73b22d9cce390504c5225ceaae8731854
Author: Hermès Bélusca-Maïto 
AuthorDate: Sun Oct 8 15:46:02 2017 +0200

Add a small descriptive comment for the reason why the chosen files are 
specified in a .gitattributes file.
---
 boot/bootdata/.gitattributes  | 2 +-
 hal/halx86/legacy/bus/.gitattributes  | 1 +
 subsystems/mvdm/config/.gitattributes | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/boot/bootdata/.gitattributes b/boot/bootdata/.gitattributes
index 6b7a8fc6dc..38f873f93f 100644
--- a/boot/bootdata/.gitattributes
+++ b/boot/bootdata/.gitattributes
@@ -1,2 +1,2 @@
-# This one will be distributed in the ISO.
+# The README file is distributed in the ISO.
 readme.txt text eol=crlf
diff --git a/hal/halx86/legacy/bus/.gitattributes 
b/hal/halx86/legacy/bus/.gitattributes
index d58638ba9b..0ddf4ebe1b 100644
--- a/hal/halx86/legacy/bus/.gitattributes
+++ b/hal/halx86/legacy/bus/.gitattributes
@@ -1,2 +1,3 @@
+# The HAL expects these files to be in CR-LF.
 pci_classes.ids text eol=crlf
 pci_vendors.ids text eol=crlf
diff --git a/subsystems/mvdm/config/.gitattributes 
b/subsystems/mvdm/config/.gitattributes
index f95b66d5ee..2eaecf386d 100644
--- a/subsystems/mvdm/config/.gitattributes
+++ b/subsystems/mvdm/config/.gitattributes
@@ -1,2 +1,3 @@
+# These files are distributed with ReactOS.
 AUTOEXEC.NT text eol=crlf
 CONFIG.NT text eol=crlf



[ros-diffs] [reactos] 02/02: [KERNEL32]: Add a .gitattributes file for the winnls resource files. The .nls files in winnls are actual resource text files for kernel32 and not binary NLS files. Therefo

2017-10-08 Thread Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d260385023d73e1294aba17fc7e7f1f4fa6194d3

commit d260385023d73e1294aba17fc7e7f1f4fa6194d3
Author: Hermès Bélusca-Maïto 
AuthorDate: Sun Oct 8 15:47:55 2017 +0200

[KERNEL32]: Add a .gitattributes file for the winnls resource files.
The .nls files in winnls are actual resource text files for kernel32 and 
not binary NLS files.
Therefore treat them as such.
---
 dll/win32/kernel32/winnls/nls/.gitattributes | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dll/win32/kernel32/winnls/nls/.gitattributes 
b/dll/win32/kernel32/winnls/nls/.gitattributes
new file mode 100644
index 00..471ea5e296
--- /dev/null
+++ b/dll/win32/kernel32/winnls/nls/.gitattributes
@@ -0,0 +1,3 @@
+# The files in this directory are actual resource text files,
+# and not binary NLS files.
+*.nls text



[ros-diffs] [reactos] 01/01: [AMSTREAM] We don't need to define WIDL_C_INLINE_WRAPPERS here anymore.

2017-10-08 Thread Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e7054d7688e14c4a85f72cac70959a101d5f976c

commit e7054d7688e14c4a85f72cac70959a101d5f976c
Author: Amine Khaldi 
AuthorDate: Sun Oct 8 14:32:50 2017 +0100

[AMSTREAM] We don't need to define WIDL_C_INLINE_WRAPPERS here anymore.
---
 dll/directx/wine/amstream/CMakeLists.txt | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/dll/directx/wine/amstream/CMakeLists.txt 
b/dll/directx/wine/amstream/CMakeLists.txt
index 695b778ffc..b6e6b869aa 100644
--- a/dll/directx/wine/amstream/CMakeLists.txt
+++ b/dll/directx/wine/amstream/CMakeLists.txt
@@ -1,7 +1,5 @@
 
-add_definitions(
--D__WINESRC__
--DWIDL_C_INLINE_WRAPPERS)
+add_definitions(-D__WINESRC__)
 
 include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
 spec2def(amstream.dll amstream.spec)



[ros-diffs] [reactos] 01/01: [MSCOREE] Fix build.

2017-10-08 Thread Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e38cdd2f62c26bf0610afa6c41a93561cda07bc3

commit e38cdd2f62c26bf0610afa6c41a93561cda07bc3
Author: Amine Khaldi 
AuthorDate: Sun Oct 8 14:28:58 2017 +0100

[MSCOREE] Fix build.
---
 dll/win32/mscoree/cordebug.c   | 8 
 dll/win32/mscoree/corruntimehost.c | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/dll/win32/mscoree/cordebug.c b/dll/win32/mscoree/cordebug.c
index d1601fcae7..0a06a94178 100644
--- a/dll/win32/mscoree/cordebug.c
+++ b/dll/win32/mscoree/cordebug.c
@@ -67,7 +67,7 @@ static HRESULT WINAPI 
cordebugprocess_QueryInterface(ICorDebugProcess *iface,
 return E_NOINTERFACE;
 }
 
-ICorDebug_AddRef(iface);
+ICorDebugProcess_AddRef(iface);
 
 return S_OK;
 }
@@ -413,7 +413,7 @@ static HRESULT CorDebugProcess_Create(CorDebug *cordebug, 
IUnknown** ppUnk, LPPR
 if(This->cordebug)
 ICorDebug_AddRef(>cordebug->ICorDebug_iface);
 
-*ppUnk = (IUnknown*)This;
+*ppUnk = (IUnknown*)>ICorDebugProcess_iface;
 
 return S_OK;
 }
@@ -437,7 +437,7 @@ static HRESULT WINAPI 
process_enum_QueryInterface(ICorDebugProcessEnum *iface, R
 return E_NOINTERFACE;
 }
 
-ICorDebug_AddRef(iface);
+ICorDebugProcessEnum_AddRef(iface);
 
 return S_OK;
 }
@@ -759,7 +759,7 @@ HRESULT CorDebug_Create(ICLRRuntimeHost *runtimehost, 
IUnknown** ppUnk)
 if(This->runtimehost)
 ICLRRuntimeHost_AddRef(This->runtimehost);
 
-*ppUnk = (IUnknown*)This;
+*ppUnk = (IUnknown*)>ICorDebug_iface;
 
 return S_OK;
 }
diff --git a/dll/win32/mscoree/corruntimehost.c 
b/dll/win32/mscoree/corruntimehost.c
index 847d6fa821..2c8f2cbfd3 100644
--- a/dll/win32/mscoree/corruntimehost.c
+++ b/dll/win32/mscoree/corruntimehost.c
@@ -919,7 +919,7 @@ static void CDECL ReallyFixupVTable(struct dll_fixup *fixup)
 }
 
 if (info != NULL)
-ICLRRuntimeHost_Release(info);
+ICLRRuntimeInfo_Release(info);
 
 HeapFree(GetProcessHeap(), 0, filenameA);
 



[ros-diffs] [reactos] 01/01: [PSDK] Update unknwn.idl. CORE-13762

2017-10-08 Thread Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6cdefd33e1f79327f98070835b132ee581d77122

commit 6cdefd33e1f79327f98070835b132ee581d77122
Author: Amine Khaldi 
AuthorDate: Sun Oct 8 14:04:24 2017 +0100

[PSDK] Update unknwn.idl. CORE-13762
---
 sdk/include/psdk/unknwn.idl | 23 ++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/sdk/include/psdk/unknwn.idl b/sdk/include/psdk/unknwn.idl
index 9071973fbe..7856a7f504 100644
--- a/sdk/include/psdk/unknwn.idl
+++ b/sdk/include/psdk/unknwn.idl
@@ -20,7 +20,14 @@
 import "wtypes.idl";
 #endif
 
-/* Interfaces */
+cpp_quote("#ifdef __WINESRC__")
+cpp_quote("#define WIDL_C_INLINE_WRAPPERS")
+cpp_quote("#endif")
+
+cpp_quote("#ifdef WIDL_C_INLINE_WRAPPERS")
+cpp_quote("#define SAVE_WIDL_C_INLINE_WRAPPERS")
+cpp_quote("#undef WIDL_C_INLINE_WRAPPERS")
+cpp_quote("#endif")
 
 [
   local,
@@ -39,6 +46,20 @@ interface IUnknown
   ULONG Release();
 }
 
+cpp_quote("HRESULT STDMETHODCALLTYPE IUnknown_QueryInterface_Proxy(IUnknown* 
This, REFIID riid, void **ppvObject);")
+cpp_quote("void __RPC_STUB IUnknown_QueryInterface_Stub(IRpcStubBuffer* This, 
IRpcChannelBuffer* pRpcChannelBuffer,")
+cpp_quote(" PRPC_MESSAGE pRpcMessage, DWORD* pdwStubPhase);")
+cpp_quote("ULONG STDMETHODCALLTYPE IUnknown_AddRef_Proxy(IUnknown* This);")
+cpp_quote("void __RPC_STUB IUnknown_AddRef_Stub(IRpcStubBuffer* This, 
IRpcChannelBuffer* pRpcChannelBuffer,")
+cpp_quote(" PRPC_MESSAGE pRpcMessage, DWORD* pdwStubPhase);")
+cpp_quote("ULONG STDMETHODCALLTYPE IUnknown_Release_Proxy(IUnknown* This);")
+cpp_quote("void __RPC_STUB IUnknown_Release_Stub(IRpcStubBuffer* This, 
IRpcChannelBuffer* pRpcChannelBuffer,")
+cpp_quote(" PRPC_MESSAGE pRpcMessage, DWORD* pdwStubPhase);")
+
+cpp_quote("#ifdef SAVE_WIDL_C_INLINE_WRAPPERS")
+cpp_quote("#define WIDL_C_INLINE_WRAPPERS")
+cpp_quote("#endif")
+
 [
   object,
   uuid(0001---C000-0046),



[ros-diffs] [reactos] 01/01: [NTOSKRNL] Add back parentheses that got removed in r75605

2017-10-08 Thread Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=24856b8de6abc6abb569d9cd3158e7eeac70fdb4

commit 24856b8de6abc6abb569d9cd3158e7eeac70fdb4
Author: Timo Kreuzer 
AuthorDate: Sun Oct 8 14:13:47 2017 +0200

[NTOSKRNL] Add back parentheses that got removed in r75605
---
 ntoskrnl/include/internal/mm.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ntoskrnl/include/internal/mm.h b/ntoskrnl/include/internal/mm.h
index ade96213ed..694c51f1f0 100644
--- a/ntoskrnl/include/internal/mm.h
+++ b/ntoskrnl/include/internal/mm.h
@@ -200,8 +200,8 @@ typedef struct _ROS_SECTION_OBJECT
 };
 } ROS_SECTION_OBJECT, *PROS_SECTION_OBJECT;
 
-#define MA_GetStartingAddress(_MemoryArea) (_MemoryArea->VadNode.StartingVpn 
<< PAGE_SHIFT)
-#define MA_GetEndingAddress(_MemoryArea) ((_MemoryArea->VadNode.EndingVpn + 1) 
<< PAGE_SHIFT)
+#define MA_GetStartingAddress(_MemoryArea) ((_MemoryArea)->VadNode.StartingVpn 
<< PAGE_SHIFT)
+#define MA_GetEndingAddress(_MemoryArea) (((_MemoryArea)->VadNode.EndingVpn + 
1) << PAGE_SHIFT)
 
 typedef struct _MEMORY_AREA
 {



[ros-diffs] [reactos] 01/01: [WIDL] Sync with Wine Staging 2.16. CORE-13762

2017-10-08 Thread Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=891d81e058237344de3fe4e183f6b1933d1f2bbc

commit 891d81e058237344de3fe4e183f6b1933d1f2bbc
Author: Amine Khaldi 
AuthorDate: Sun Oct 8 10:52:42 2017 +0100

[WIDL] Sync with Wine Staging 2.16. CORE-13762

b42a155 widl: Handle C++ aggregate returns in a MSVC compatible way.
084fa63 widl: Only generate Proxy Stubs when functions have the call_as 
attribute.
fbdf119 widl: Try to find imported typelib using .tlb extension if it 
wasn't specified.
---
 media/doc/README.WINE|  2 +-
 sdk/tools/widl/header.c  | 53 ++--
 sdk/tools/widl/typelib.c | 36 
 3 files changed, 80 insertions(+), 11 deletions(-)

diff --git a/media/doc/README.WINE b/media/doc/README.WINE
index 1a7c651da6..8dcdd23aa5 100644
--- a/media/doc/README.WINE
+++ b/media/doc/README.WINE
@@ -16,7 +16,7 @@ wine-patc...@winehq.com and ros-...@reactos.org
 The following build tools are shared with Wine.
 
 reactos/sdk/tools/unicode   # Synced to WineStaging-2.9
-reactos/sdk/tools/widl  # Synced to WineStaging-2.9
+reactos/sdk/tools/widl  # Synced to WineStaging-2.16
 reactos/sdk/tools/wpp   # Synced to WineStaging-2.9
 
 The following libraries are shared with Wine.
diff --git a/sdk/tools/widl/header.c b/sdk/tools/widl/header.c
index a5dadbaf68..27bca0ed0d 100644
--- a/sdk/tools/widl/header.c
+++ b/sdk/tools/widl/header.c
@@ -1043,13 +1043,62 @@ static void write_cpp_method_def(FILE *header, const 
type_t *iface)
 const var_t *func = stmt->u.var;
 if (!is_callas(func->attrs)) {
   const char *callconv = get_attrp(func->type->attrs, ATTR_CALLCONV);
+  const var_list_t *args = type_get_function_args(func->type);
+  const var_t *arg;
+
   if (!callconv) callconv = "STDMETHODCALLTYPE";
+
+  if (is_aggregate_return(func)) {
+fprintf(header, "#ifdef WIDL_EXPLICIT_AGGREGATE_RETURNS\n");
+
+indent(header, 0);
+fprintf(header, "virtual ");
+write_type_decl_left(header, type_function_get_rettype(func->type));
+fprintf(header, "* %s %s(\n", callconv, get_name(func));
+++indentation;
+indent(header, 0);
+write_type_decl_left(header, type_function_get_rettype(func->type));
+fprintf(header, " *__ret");
+--indentation;
+if (args) {
+  fprintf(header, ",\n");
+  write_args(header, args, iface->name, 2, TRUE);
+}
+fprintf(header, ") = 0;\n");
+
+indent(header, 0);
+write_type_decl_left(header, type_function_get_rettype(func->type));
+fprintf(header, " %s %s(\n", callconv, get_name(func));
+write_args(header, args, iface->name, 2, TRUE);
+fprintf(header, ")\n");
+indent(header, 0);
+fprintf(header, "{\n");
+++indentation;
+indent(header, 0);
+write_type_decl_left(header, type_function_get_rettype(func->type));
+fprintf(header, " __ret;\n");
+indent(header, 0);
+fprintf(header, "return *%s(&__ret", get_name(func));
+if (args)
+LIST_FOR_EACH_ENTRY(arg, args, const var_t, entry)
+fprintf(header, ", %s", arg->name);
+fprintf(header, ");\n");
+--indentation;
+indent(header, 0);
+fprintf(header, "}\n");
+
+fprintf(header, "#else\n");
+  }
+
   indent(header, 0);
   fprintf(header, "virtual ");
   write_type_decl_left(header, type_function_get_rettype(func->type));
   fprintf(header, " %s %s(\n", callconv, get_name(func));
-  write_args(header, type_get_function_args(func->type), iface->name, 2, 
TRUE);
+  write_args(header, args, iface->name, 2, TRUE);
   fprintf(header, ") = 0;\n");
+
+  if (is_aggregate_return(func))
+fprintf(header, "#endif\n");
   fprintf(header, "\n");
 }
   }
@@ -1181,7 +1230,7 @@ static void write_method_proto(FILE *header, const type_t 
*iface)
   {
 const var_t *func = stmt->u.var;
 
-if (!is_local(func->attrs)) {
+if (is_callas(func->attrs)) {
   const char *callconv = get_attrp(func->type->attrs, ATTR_CALLCONV);
   if (!callconv) callconv = "STDMETHODCALLTYPE";
   /* proxy prototype */
diff --git a/sdk/tools/widl/typelib.c b/sdk/tools/widl/typelib.c
index f8f92e2062..ba71de71ab 100644
--- a/sdk/tools/widl/typelib.c
+++ b/sdk/tools/widl/typelib.c
@@ -327,22 +327,42 @@ static void read_msft_importlib(importlib_t *importlib, 
int fd)
 free(typeinfo_offs);
 }
 
+static int open_typelib(const char *name)
+{
+char *file_name;
+int fd;
+
+file_name = wpp_find_include(name, NULL);
+if(!file_name)
+return open(name, O_RDONLY | O_BINARY );
+
+fd = open(file_name, O_RDONLY | O_BINARY );
+free(file_name);
+return fd;
+}
+
 static void read_importlib(importlib_t *importlib)
 {
 int fd;

[ros-diffs] [reactos] 02/02: [ADVAPI32_WINETEST] Sync with Wine Staging 2.16. CORE-13762

2017-10-08 Thread Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=561bed7b55ea36aecbfcda4da919bc5a77d43636

commit 561bed7b55ea36aecbfcda4da919bc5a77d43636
Author: Amine Khaldi 
AuthorDate: Sun Oct 8 11:06:20 2017 +0100

[ADVAPI32_WINETEST] Sync with Wine Staging 2.16. CORE-13762
---
 modules/rostests/winetests/advapi32/CMakeLists.txt |2 +-
 modules/rostests/winetests/advapi32/eventlog.c |4 -
 modules/rostests/winetests/advapi32/registry.c |  199 ++-
 modules/rostests/winetests/advapi32/security.c | 1322 ++--
 4 files changed, 1103 insertions(+), 424 deletions(-)

diff --git a/modules/rostests/winetests/advapi32/CMakeLists.txt 
b/modules/rostests/winetests/advapi32/CMakeLists.txt
index d6958f4c63..5005dd5adf 100644
--- a/modules/rostests/winetests/advapi32/CMakeLists.txt
+++ b/modules/rostests/winetests/advapi32/CMakeLists.txt
@@ -22,5 +22,5 @@ if(NOT MSVC)
 endif()
 
 set_module_type(advapi32_winetest win32cui)
-add_importlibs(advapi32_winetest advapi32 ole32 msvcrt kernel32 ntdll)
+add_importlibs(advapi32_winetest advapi32 ole32 user32 msvcrt kernel32 ntdll)
 add_rostests_file(TARGET advapi32_winetest)
diff --git a/modules/rostests/winetests/advapi32/eventlog.c 
b/modules/rostests/winetests/advapi32/eventlog.c
index be9b4673ae..8c78dcf73f 100644
--- a/modules/rostests/winetests/advapi32/eventlog.c
+++ b/modules/rostests/winetests/advapi32/eventlog.c
@@ -1209,11 +1209,7 @@ static void test_start_trace(void)
 ret = StartTraceA(, sessionname, properties);
 todo_wine
 ok(ret == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got 
%d\n", ret);
-#ifndef __REACTOS__
-properties->Wnode.Guid = (GUID){0};
-#else
 memset(>Wnode.Guid, 0, sizeof(properties->Wnode.Guid));
-#endif
 
 properties->LogFileNameOffset = 0;
 ret = StartTraceA(, sessionname, properties);
diff --git a/modules/rostests/winetests/advapi32/registry.c 
b/modules/rostests/winetests/advapi32/registry.c
index 8af1ebf938..053113a293 100644
--- a/modules/rostests/winetests/advapi32/registry.c
+++ b/modules/rostests/winetests/advapi32/registry.c
@@ -3523,40 +3523,76 @@ static void test_RegNotifyChangeKeyValue(void)
 CloseHandle(event);
 }
 
+static const char *dbgstr_longlong(ULONGLONG ll)
+{
+static char buf[16][64];
+static int idx;
+
+idx &= 0x0f;
+
+if (sizeof(ll) > sizeof(unsigned long) && ll >> 32)
+sprintf(buf[idx], "0x%lx%08lx", (unsigned long)(ll >> 32), (unsigned 
long)ll);
+else
+sprintf(buf[idx], "0x%08lx", (unsigned long)ll);
+
+return buf[idx++];
+}
+
+#define cmp_li(a, b, c) cmp_li_real(a, b, c, __LINE__)
+static void cmp_li_real(LARGE_INTEGER *l1, LARGE_INTEGER *l2, LONGLONG slack, 
int line)
+{
+LONGLONG diff = l2->QuadPart - l1->QuadPart;
+if (diff < 0) diff = -diff;
+ok_(__FILE__, line)(diff <= slack, "values don't match: %s/%s\n",
+dbgstr_longlong(l1->QuadPart), dbgstr_longlong(l2->QuadPart));
+}
+
 static void test_RegQueryValueExPerformanceData(void)
 {
-DWORD cbData, len;
+static const WCHAR globalW[] = { 'G','l','o','b','a','l',0 };
+static const WCHAR dummyW[5] = { 'd','u','m','m','y' };
+static const char * const names[] = { NULL, "", "Global", "2" "invalid 
counter name" };
+DWORD cbData, len, i, type;
 BYTE *value;
 DWORD dwret;
 LONG limit = 6;
 PERF_DATA_BLOCK *pdb;
+HKEY hkey;
+BYTE buf[256 + sizeof(PERF_DATA_BLOCK)];
 
 /* Test with data == NULL */
 dwret = RegQueryValueExA( HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, 
NULL,  );
-todo_wine ok( dwret == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got 
%d\n", dwret );
+ok( dwret == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %d\n", dwret 
);
+
+dwret = RegQueryValueExW( HKEY_PERFORMANCE_DATA, globalW, NULL, NULL, 
NULL,  );
+ok( dwret == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %d\n", dwret 
);
 
 /* Test ERROR_MORE_DATA, start with small buffer */
 len = 10;
 value = HeapAlloc(GetProcessHeap(), 0, len);
 cbData = len;
-dwret = RegQueryValueExA( HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, 
value,  );
-todo_wine ok( dwret == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got 
%d\n", dwret );
+type = 0xdeadbeef;
+dwret = RegQueryValueExA( HKEY_PERFORMANCE_DATA, "Global", NULL, , 
value,  );
+ok( dwret == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %d\n", dwret 
);
+ok(type == REG_BINARY, "got %u\n", type);
 while( dwret == ERROR_MORE_DATA && limit)
 {
 len = len * 10;
 value = HeapReAlloc( GetProcessHeap(), 0, value, len );
 cbData = len;
-dwret = RegQueryValueExA( HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, 
value,  );
+type = 0xdeadbeef;
+dwret = RegQueryValueExA( HKEY_PERFORMANCE_DATA, "Global", NULL, 
, value,  );
 limit--;
 }
 ok(limit > 0, "too many times ERROR_MORE_DATA returned\n");
 
-todo_wine ok(dwret == 

[ros-diffs] [reactos] 01/02: [PSDK] Add missing CreateRestrictedToken() declaration. CORE-13762

2017-10-08 Thread Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=babc61c5ee09a24161745808842c2e0b5349cd7f

commit babc61c5ee09a24161745808842c2e0b5349cd7f
Author: Amine Khaldi 
AuthorDate: Sun Oct 8 11:05:53 2017 +0100

[PSDK] Add missing CreateRestrictedToken() declaration. CORE-13762
---
 sdk/include/psdk/winbase.h | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/sdk/include/psdk/winbase.h b/sdk/include/psdk/winbase.h
index 19462021c9..09812fc128 100644
--- a/sdk/include/psdk/winbase.h
+++ b/sdk/include/psdk/winbase.h
@@ -1689,6 +1689,20 @@ CreateProcessAsUserA(
 
 BOOL WINAPI 
CreateProcessAsUserW(HANDLE,LPCWSTR,LPWSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,PVOID,LPCWSTR,LPSTARTUPINFOW,LPPROCESS_INFORMATION);
 HANDLE WINAPI 
CreateRemoteThread(HANDLE,LPSECURITY_ATTRIBUTES,DWORD,LPTHREAD_START_ROUTINE,LPVOID,DWORD,LPDWORD);
+
+BOOL
+WINAPI
+CreateRestrictedToken(
+  _In_ HANDLE ExistingTokenHandle,
+  _In_ DWORD Flags,
+  _In_ DWORD DisableSidCount,
+  _In_reads_opt_(DisableSidCount) PSID_AND_ATTRIBUTES SidsToDisable,
+  _In_ DWORD DeletePrivilegeCount,
+  _In_reads_opt_(DeletePrivilegeCount) PLUID_AND_ATTRIBUTES PrivilegesToDelete,
+  _In_ DWORD RestrictedSidCount,
+  _In_reads_opt_(RestrictedSidCount) PSID_AND_ATTRIBUTES SidsToRestrict,
+  _Outptr_ PHANDLE NewTokenHandle);
+
 _Ret_maybenull_ HANDLE WINAPI CreateSemaphoreA(_In_opt_ LPSECURITY_ATTRIBUTES, 
_In_ LONG, _In_ LONG, _In_opt_ LPCSTR);
 _Ret_maybenull_ HANDLE WINAPI CreateSemaphoreW(_In_opt_ LPSECURITY_ATTRIBUTES, 
_In_ LONG, _In_ LONG, _In_opt_ LPCWSTR);
 #if (_WIN32_WINNT >= 0x0600)



[ros-diffs] [reactos] 01/01: [TRAVIS-CI] Initial version of the Travis-CI script.

2017-10-08 Thread Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d77464b3d695c65f13e0196d46dc1081bdf273b5

commit d77464b3d695c65f13e0196d46dc1081bdf273b5
Author: Amine Khaldi 
AuthorDate: Sun Oct 8 13:38:07 2017 +0100

[TRAVIS-CI] Initial version of the Travis-CI script.
---
 .travis.yml | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00..643416724e
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,10 @@
+language: bash
+
+git:
+  depth: 1
+
+before_script:
+- wget https://svn.reactos.org/amine/RosBEBinFull.tar.gz -O RosBE.tar.gz
+- tar -xzf RosBE.tar.gz
+- echo 'mkdir ../Build && cd ../Build && $TRAVIS_BUILD_DIR/configure.sh 
-DENABLE_ROSTESTS=1 && cd reactos && ninja && ninja bootcd' > tmp_file
+- ./RosBEBinFull/RosBE.sh < tmp_file
\ No newline at end of file



[ros-diffs] [reactos] 01/01: [MSDMO] Fix build.

2017-10-08 Thread Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=57cda5aa7d072db5b522a6fad4d9d03ecaf8b608

commit 57cda5aa7d072db5b522a6fad4d9d03ecaf8b608
Author: Amine Khaldi 
AuthorDate: Sun Oct 8 12:28:23 2017 +0100

[MSDMO] Fix build.
---
 dll/directx/wine/msdmo/precomp.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dll/directx/wine/msdmo/precomp.h b/dll/directx/wine/msdmo/precomp.h
index d952772c24..ceb8d707d8 100644
--- a/dll/directx/wine/msdmo/precomp.h
+++ b/dll/directx/wine/msdmo/precomp.h
@@ -11,6 +11,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 #include 



[ros-diffs] [reactos] 01/01: [SHLWAPI] Highlight a difference and mark the module as synced with Wine Staging 2.16. CORE-13762

2017-10-08 Thread Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7d346cbc7305d1b4a81eafaeb3b289e0cfc6730e

commit 7d346cbc7305d1b4a81eafaeb3b289e0cfc6730e
Author: Amine Khaldi 
AuthorDate: Sun Oct 8 09:38:10 2017 +0100

[SHLWAPI] Highlight a difference and mark the module as synced with Wine 
Staging 2.16. CORE-13762
---
 dll/win32/shlwapi/ordinal.c | 4 
 media/doc/README.WINE   | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/dll/win32/shlwapi/ordinal.c b/dll/win32/shlwapi/ordinal.c
index a6c67a9e72..4e331f4800 100644
--- a/dll/win32/shlwapi/ordinal.c
+++ b/dll/win32/shlwapi/ordinal.c
@@ -3501,7 +3501,11 @@ HRESULT WINAPI SHInvokeCommand(HWND hWnd, IShellFolder* 
lpFolder, LPCITEMIDLIST
   cmIci.cbSize = sizeof(cmIci);
   cmIci.fMask = CMIC_MASK_ASYNCOK;
   cmIci.hwnd = hWnd;
+#ifdef __REACTOS__ /* r75561 */
   cmIci.lpVerb = MAKEINTRESOURCEA(dwCommandId - 1);
+#else
+  cmIci.lpVerb = MAKEINTRESOURCEA(dwCommandId);
+#endif
   cmIci.nShow = SW_SHOWNORMAL;
 
   hRet = IContextMenu_InvokeCommand(iContext, );
diff --git a/media/doc/README.WINE b/media/doc/README.WINE
index 1eca9ef9cc..1a7c651da6 100644
--- a/media/doc/README.WINE
+++ b/media/doc/README.WINE
@@ -174,7 +174,7 @@ reactos/dll/win32/shdoclc # Synced to 
WineStaging-2.9
 reactos/dll/win32/shdocvw # Synced to WineStaging-2.9
 reactos/dll/win32/shell32 # Forked at Wine-20071011
 reactos/dll/win32/shfolder# Synced to WineStaging-2.9
-reactos/dll/win32/shlwapi # Synced to WineStaging-2.9
+reactos/dll/win32/shlwapi # Synced to WineStaging-2.16
 reactos/dll/win32/slbcsp  # Synced to WineStaging-2.9
 reactos/dll/win32/snmpapi # Synced to WineStaging-2.9
 reactos/dll/win32/softpub # Synced to WineStaging-2.9



[ros-diffs] [reactos] 01/01: [MSIEXEC] Sync with Wine Staging 2.16. CORE-13762

2017-10-08 Thread Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0c6498fa67f32d83ccf5505f2dc9ac6e5c1c2541

commit 0c6498fa67f32d83ccf5505f2dc9ac6e5c1c2541
Author: Amine Khaldi 
AuthorDate: Sun Oct 8 09:33:23 2017 +0100

[MSIEXEC] Sync with Wine Staging 2.16. CORE-13762

d73c38f msiexec: Fix parsing of command lines where quoted strings and 
properties are not separated by whitespace.
---
 base/system/msiexec/msiexec.c | 169 ++
 media/doc/README.WINE |   2 +-
 2 files changed, 88 insertions(+), 83 deletions(-)

diff --git a/base/system/msiexec/msiexec.c b/base/system/msiexec/msiexec.c
index 44f1f28862..f2155622de 100644
--- a/base/system/msiexec/msiexec.c
+++ b/base/system/msiexec/msiexec.c
@@ -212,14 +212,6 @@ static DWORD msi_atou(LPCWSTR str)
return ret;
 }
 
-static LPWSTR msi_strdup(LPCWSTR str)
-{
-   DWORD len = lstrlenW(str)+1;
-   LPWSTR ret = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*len);
-   lstrcpyW(ret, str);
-   return ret;
-}
-
 /* str1 is the same as str2, ignoring case */
 static BOOL msi_strequal(LPCWSTR str1, LPCSTR str2)
 {
@@ -409,90 +401,103 @@ static INT DoEmbedding( LPWSTR key )
 
 enum chomp_state
 {
-   cs_whitespace,
-   cs_token,
-   cs_quote
+CS_WHITESPACE,
+CS_TOKEN,
+CS_QUOTE
 };
 
-static int chomp( WCHAR *str )
+static int chomp( const WCHAR *in, WCHAR *out )
 {
-   enum chomp_state state = cs_token;
-   WCHAR *p, *out;
-int count = 1;
-BOOL ignore;
-
-   for( p = str, out = str; *p; p++ )
-   {
-ignore = TRUE;
-   switch( state )
-   {
-   case cs_whitespace:
-   switch( *p )
-   {
-   case ' ':
-   break;
-   case '"':
-   state = cs_quote;
-   count++;
-   break;
-   default:
-   count++;
-ignore = FALSE;
-   state = cs_token;
-   }
-   break;
-
-   case cs_token:
-   switch( *p )
-   {
-   case '"':
-   state = cs_quote;
-   break;
-   case ' ':
-   state = cs_whitespace;
-   *out++ = 0;
-   break;
-   default:
-ignore = FALSE;
-   }
-   break;
-
-   case cs_quote:
-   switch( *p )
-   {
-   case '"':
-   state = cs_token;
-   break;
-   default:
-ignore = FALSE;
-   }
-   break;
-   }
-   if( !ignore )
-   *out++ = *p;
-   }
-
-   *out = 0;
+enum chomp_state state = CS_TOKEN;
+const WCHAR *p;
+int count = 1;
+BOOL ignore;
 
-   return count;
+for (p = in; *p; p++)
+{
+ignore = TRUE;
+switch (state)
+{
+case CS_WHITESPACE:
+switch (*p)
+{
+case ' ':
+break;
+case '"':
+state = CS_QUOTE;
+count++;
+break;
+default:
+count++;
+ignore = FALSE;
+state = CS_TOKEN;
+}
+break;
+
+case CS_TOKEN:
+switch (*p)
+{
+case '"':
+state = CS_QUOTE;
+break;
+case ' ':
+state = CS_WHITESPACE;
+if (out) *out++ = 0;
+break;
+default:
+if (p > in && p[-1] == '"')
+{
+if (out) *out++ = 0;
+count++;
+}
+ignore = FALSE;
+}
+break;
+
+case CS_QUOTE:
+switch (*p)
+{
+case '"':
+state = CS_TOKEN;
+break;
+default:
+ignore = FALSE;
+}
+break;
+}
+if (!ignore && out) *out++ = *p;
+}
+if (out) *out = 0;
+return count;
 }
 
 static void process_args( WCHAR *cmdline, int *pargc, WCHAR ***pargv )
 {
-   WCHAR **argv, *p = msi_strdup(cmdline);
-   int i, n;
+WCHAR **argv, *p;
+int i, count;
 
-   n = chomp( p );
-   argv = HeapAlloc(GetProcessHeap(), 0, sizeof (WCHAR*)*(n+1));
-   

[ros-diffs] [reactos] 03/04: [WMVCORE] Sync with Wine Staging 2.16. CORE-13762

2017-10-08 Thread Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ea59f30f8694a2a4cfb3d7d8a52d3aa0240cbf1f

commit ea59f30f8694a2a4cfb3d7d8a52d3aa0240cbf1f
Author: Amine Khaldi 
AuthorDate: Sun Oct 8 10:30:08 2017 +0100

[WMVCORE] Sync with Wine Staging 2.16. CORE-13762

998fe04 wmvcore: Support IWMPacketSize2 interfaces in IWMReader.
0570cf9 wmvcore: Support IWMProfile3 interfaces in IWMReader.
98e94b2 wmvcore: Support IReferenceClock interfaces in IWMReader.
163aac1 wmvcore: Support IWMLanguageList interfaces in IWMReader.
b1702c4 wmvcore: Support IWMHeaderInfo/2/3 interfaces in IWMReader.
73f8066 wmvcore: Support IWMReaderPlaylistBurn interface in IWMReader.
b15c398 wmvcore: Support IWMReaderTimecode interface in IWMReader.
465feb7 wmvcore: Support IWMReaderTypeNegotiation interface in IWMReader.
437c667 wmvcore: Support IWMReaderStreamClock interface in IWMReader.
34b9b10 wmvcore: Support IWMReaderNetworkConfig1/2 interfaces in IWMReader.
94af027 wmvcore: Support IWMReaderAccelerator in IWMReader.
3f6b7c3 wmvcore: Add WMCheckURLScheme stub.
7381cec wmvcore: Implement WMCreateWriterPriv.
---
 dll/win32/wmvcore/CMakeLists.txt |2 +-
 dll/win32/wmvcore/wmvcore.spec   |4 +-
 dll/win32/wmvcore/wmvcore_main.c | 1432 +-
 dll/win32/wmvcore/writer.c   |5 +
 media/doc/README.WINE|2 +-
 5 files changed, 1440 insertions(+), 5 deletions(-)

diff --git a/dll/win32/wmvcore/CMakeLists.txt b/dll/win32/wmvcore/CMakeLists.txt
index d67e20dfc7..094ded5ecb 100644
--- a/dll/win32/wmvcore/CMakeLists.txt
+++ b/dll/win32/wmvcore/CMakeLists.txt
@@ -1,7 +1,7 @@
 
 add_definitions(-D__WINESRC__)
 include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
-spec2def(wmvcore.dll wmvcore.spec)
+spec2def(wmvcore.dll wmvcore.spec ADD_IMPORTLIB)
 
 list(APPEND SOURCE
 wmvcore_main.c
diff --git a/dll/win32/wmvcore/wmvcore.spec b/dll/win32/wmvcore/wmvcore.spec
index bb17683b55..f3e3b64122 100644
--- a/dll/win32/wmvcore/wmvcore.spec
+++ b/dll/win32/wmvcore/wmvcore.spec
@@ -1,5 +1,5 @@
 @ stub WMCheckURLExtension
-@ stub WMCheckURLScheme
+@ stdcall WMCheckURLScheme(wstr)
 @ stub WMCreateBackupRestorerPrivate
 @ stub WMCreateSyncReaderPriv
 @ stub WMIsAvailableOffline
@@ -15,6 +15,6 @@
 @ stdcall WMCreateWriter(ptr ptr)
 @ stub WMCreateWriterFileSink
 @ stub WMCreateWriterNetworkSink
-@ stub WMCreateWriterPriv
+@ stdcall WMCreateWriterPriv(ptr)
 @ stub WMCreateWriterPushSink
 @ stub WMIsContentProtected
diff --git a/dll/win32/wmvcore/wmvcore_main.c b/dll/win32/wmvcore/wmvcore_main.c
index d196079698..be07909730 100644
--- a/dll/win32/wmvcore/wmvcore_main.c
+++ b/dll/win32/wmvcore/wmvcore_main.c
@@ -19,7 +19,7 @@
 #include "wmvcore.h"
 
 #include "initguid.h"
-#include "wmsdkidl.h"
+#include "wmsdk.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(wmvcore);
@@ -47,6 +47,13 @@ HRESULT WINAPI DllRegisterServer(void)
 return S_OK;
 }
 
+HRESULT WINAPI WMCheckURLScheme(const WCHAR *scheme)
+{
+FIXME("(%s): stub\n", wine_dbgstr_w(scheme));
+
+return NS_E_INVALID_NAME;
+}
+
 HRESULT WINAPI WMCreateEditor(IWMMetadataEditor **editor)
 {
 FIXME("(%p): stub\n", editor);
@@ -59,6 +66,17 @@ HRESULT WINAPI WMCreateEditor(IWMMetadataEditor **editor)
 typedef struct {
 IWMReader IWMReader_iface;
 IWMReaderAdvanced6 IWMReaderAdvanced6_iface;
+IWMReaderAccelerator IWMReaderAccelerator_iface;
+IWMReaderNetworkConfig2 IWMReaderNetworkConfig2_iface;
+IWMReaderStreamClock IWMReaderStreamClock_iface;
+IWMReaderTypeNegotiation IWMReaderTypeNegotiation_iface;
+IWMReaderTimecode IWMReaderTimecode_iface;
+IWMReaderPlaylistBurn IWMReaderPlaylistBurn_iface;
+IWMHeaderInfo3 IWMHeaderInfo3_iface;
+IWMLanguageList IWMLanguageList_iface;
+IReferenceClock IReferenceClock_iface;
+IWMProfile3 IWMProfile3_iface;
+IWMPacketSize2 IWMPacketSize2_iface;
 LONG ref;
 } WMReader;
 
@@ -95,6 +113,57 @@ static HRESULT WINAPI WMReader_QueryInterface(IWMReader 
*iface, REFIID riid, voi
 }else if(IsEqualGUID(riid, _IWMReaderAdvanced6)) {
 TRACE("(%p)->(IID_IWMReaderAdvanced6 %p)\n", This, ppv);
 *ppv = >IWMReaderAdvanced6_iface;
+}else if(IsEqualGUID(riid, _IWMReaderAccelerator)) {
+TRACE("(%p)->(IID_IWMReaderAccelerator %p)\n", This, ppv);
+*ppv = >IWMReaderAccelerator_iface;
+}else if(IsEqualGUID(riid, _IWMReaderNetworkConfig)) {
+TRACE("(%p)->(IWMReaderNetworkConfig %p)\n", This, ppv);
+*ppv = >IWMReaderNetworkConfig2_iface;
+}else if(IsEqualGUID(riid, _IWMReaderNetworkConfig2)) {
+TRACE("(%p)->(IWMReaderNetworkConfig2 %p)\n", This, ppv);
+*ppv = >IWMReaderNetworkConfig2_iface;
+}else if(IsEqualGUID(riid, _IWMReaderStreamClock)) {
+TRACE("(%p)->(IWMReaderStreamClock %p)\n", This, ppv);
+*ppv = >IWMReaderStreamClock_iface;
+}else if(IsEqualGUID(riid, 

[ros-diffs] [reactos] 04/04: [WMVCORE_WINETEST] Import from Wine Staging 2.16. CORE-13762

2017-10-08 Thread Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=84abe02620185e5773583543aa29344f100a

commit 84abe02620185e5773583543aa29344f100a
Author: Amine Khaldi 
AuthorDate: Sun Oct 8 10:31:10 2017 +0100

[WMVCORE_WINETEST] Import from Wine Staging 2.16. CORE-13762
---
 modules/rostests/winetests/CMakeLists.txt |   1 +
 modules/rostests/winetests/wmvcore/CMakeLists.txt |   9 +
 modules/rostests/winetests/wmvcore/testlist.c |  10 +
 modules/rostests/winetests/wmvcore/wmvcore.c  | 250 ++
 4 files changed, 270 insertions(+)

diff --git a/modules/rostests/winetests/CMakeLists.txt 
b/modules/rostests/winetests/CMakeLists.txt
index 8ddf420882..52d1114c73 100644
--- a/modules/rostests/winetests/CMakeLists.txt
+++ b/modules/rostests/winetests/CMakeLists.txt
@@ -116,6 +116,7 @@ add_subdirectory(winmm)
 add_subdirectory(wintrust)
 add_subdirectory(wldap32)
 add_subdirectory(wmiutils)
+add_subdirectory(wmvcore)
 add_subdirectory(ws2_32)
 add_subdirectory(wscript)
 add_subdirectory(wshom)
diff --git a/modules/rostests/winetests/wmvcore/CMakeLists.txt 
b/modules/rostests/winetests/wmvcore/CMakeLists.txt
new file mode 100644
index 00..d7cf021827
--- /dev/null
+++ b/modules/rostests/winetests/wmvcore/CMakeLists.txt
@@ -0,0 +1,9 @@
+
+add_definitions(
+-DUSE_WINE_TODOS
+-D__WINESRC__)
+
+add_executable(wmvcore_winetest wmvcore.c testlist.c)
+set_module_type(wmvcore_winetest win32cui)
+add_importlibs(wmvcore_winetest ole32 wmvcore msvcrt kernel32)
+add_rostests_file(TARGET wmvcore_winetest)
diff --git a/modules/rostests/winetests/wmvcore/testlist.c 
b/modules/rostests/winetests/wmvcore/testlist.c
new file mode 100644
index 00..532810f645
--- /dev/null
+++ b/modules/rostests/winetests/wmvcore/testlist.c
@@ -0,0 +1,10 @@
+#define STANDALONE
+#include 
+
+extern void func_wmvcore(void);
+
+const struct test winetest_testlist[] =
+{
+{ "wmvcore", func_wmvcore },
+{ 0, 0 }
+};
diff --git a/modules/rostests/winetests/wmvcore/wmvcore.c 
b/modules/rostests/winetests/wmvcore/wmvcore.c
new file mode 100644
index 00..b11a5bf7de
--- /dev/null
+++ b/modules/rostests/winetests/wmvcore/wmvcore.c
@@ -0,0 +1,250 @@
+/*
+ * Copyright 2017 Alistair Leslie-Hughes
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+#define COBJMACROS
+#define WIN32_LEAN_AND_MEAN
+#include "initguid.h"
+#include "wmsdkidl.h"
+
+#include "wine/test.h"
+
+HRESULT WINAPI WMCreateWriterPriv(IWMWriter **writer);
+
+static void test_wmwriter_interfaces(void)
+{
+HRESULT hr;
+IWMWriter  *writer;
+IWMHeaderInfo  *header;
+IWMHeaderInfo2 *header2;
+IWMHeaderInfo3 *header3;
+
+hr = WMCreateWriter( NULL,  );
+ok(hr == S_OK, "WMCreateWriter failed 0x%08x\n", hr);
+if(FAILED(hr))
+{
+win_skip("Failed to create IWMWriter\n");
+return;
+}
+
+hr = IWMWriter_QueryInterface(writer, _IWMHeaderInfo, (void 
**));
+todo_wine ok(hr == S_OK, "Failed 0x%08x\n", hr);
+
+hr = IWMWriter_QueryInterface(writer, _IWMHeaderInfo2, (void 
**));
+todo_wine ok(hr == S_OK, "Failed 0x%08x\n", hr);
+
+hr = IWMWriter_QueryInterface(writer, _IWMHeaderInfo3, (void 
**));
+todo_wine ok(hr == S_OK, "Failed 0x%08x\n", hr);
+
+if(header)
+IWMHeaderInfo_Release(header);
+if(header2)
+IWMHeaderInfo2_Release(header2);
+if(header3)
+IWMHeaderInfo3_Release(header3);
+IWMWriter_Release(writer);
+}
+
+static void test_wmreader_interfaces(void)
+{
+HRESULT hr;
+IWMReader  *reader;
+IWMReaderAdvanced  *advanced;
+IWMReaderAdvanced2 *advanced2;
+IWMHeaderInfo  *header;
+IWMHeaderInfo2 *header2;
+IWMHeaderInfo3 *header3;
+IWMProfile *profile;
+IWMProfile2*profile2;
+IWMProfile3*profile3;
+IWMPacketSize  *packet;
+IWMPacketSize2 *packet2;
+IWMReaderAccelerator *accel;
+IWMReaderTimecode*timecode;
+IWMReaderNetworkConfig   *netconfig;
+IWMReaderNetworkConfig2  *netconfig2;
+IWMReaderStreamClock *clock;
+IWMReaderTypeNegotiation *negotiation;
+IWMDRMReader   *drmreader;
+IWMDRMReader2  *drmreader2;
+IWMDRMReader3  

[ros-diffs] [reactos] 01/04: [PSDK] Update mmreg.h and rpcndr.h. CORE-13762

2017-10-08 Thread Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dc0774d8d0e3bd3633eb68215020e7d7c5dc0bff

commit dc0774d8d0e3bd3633eb68215020e7d7c5dc0bff
Author: Amine Khaldi 
AuthorDate: Sun Oct 8 10:25:17 2017 +0100

[PSDK] Update mmreg.h and rpcndr.h. CORE-13762
---
 sdk/include/psdk/mmreg.h  | 36 
 sdk/include/psdk/rpcndr.h | 12 
 2 files changed, 48 insertions(+)

diff --git a/sdk/include/psdk/mmreg.h b/sdk/include/psdk/mmreg.h
index e0f886f8d1..c6f6b56033 100644
--- a/sdk/include/psdk/mmreg.h
+++ b/sdk/include/psdk/mmreg.h
@@ -18,6 +18,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#ifndef __WIDL__
+
 #ifndef __WINE_MMREG_H
 #define __WINE_MMREG_H
 
@@ -537,3 +539,37 @@ typedef struct tagEXBMINFOHEADER {
 #endif
 
 #endif /* __WINE_MMREG_H */
+
+#else /* __WIDL__ */
+
+cpp_quote("#if 0")
+#pragma pack(push, 1)
+
+typedef struct tWAVEFORMATEX {
+WORD wFormatTag;
+WORD nChannels;
+DWORD nSamplesPerSec;
+DWORD nAvgBytesPerSec;
+WORD nBlockAlign;
+WORD wBitsPerSample;
+WORD cbSize;
+[size_is(cbSize)] BYTE pExtraBytes[];
+} WAVEFORMATEX, *PWAVEFORMATEX, *NPWAVEFORMATEX, *LPWAVEFORMATEX;
+
+typedef struct {
+WORD wFormatTag;
+WORD nChannels;
+DWORD nSamplesPerSec;
+DWORD nAvgBytesPerSec;
+WORD nBlockAlign;
+WORD wBitsPerSample;
+WORD cbSize;
+WORD wValidBitsPerSample;
+DWORD dwChannelMask;
+GUID SubFormat;
+} WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE;
+
+#pragma pack(pop)
+cpp_quote("#endif")
+
+#endif /* __WIDL__ */
diff --git a/sdk/include/psdk/rpcndr.h b/sdk/include/psdk/rpcndr.h
index 52f419bef6..bc06335c67 100644
--- a/sdk/include/psdk/rpcndr.h
+++ b/sdk/include/psdk/rpcndr.h
@@ -42,6 +42,18 @@ extern "C" {
 # define CONST_VTBL
 #endif
 
+#ifndef EXTERN_GUID
+#ifdef __cplusplus
+#define EXTERN_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
+EXTERN_C const GUID DECLSPEC_SELECTANY name DECLSPEC_HIDDEN; \
+EXTERN_C const GUID DECLSPEC_SELECTANY name = \
+   { l, w1, w2, { b1, b2,  b3,  b4,  b5,  b6,  b7,  b8 } }
+#else
+#define EXTERN_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
+EXTERN_C const GUID name
+#endif
+#endif
+
 /* stupid #if can't handle casts... this __stupidity
is just a workaround for that limitation */
 



[ros-diffs] [reactos] 03/03: [MSI_WINETEST] Sync with Wine Staging 2.16. CORE-13762

2017-10-08 Thread Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2f8e6f711cba383e981a19d24b5a29a7bb94b616

commit 2f8e6f711cba383e981a19d24b5a29a7bb94b616
Author: Amine Khaldi 
AuthorDate: Sun Oct 8 09:15:09 2017 +0100

[MSI_WINETEST] Sync with Wine Staging 2.16. CORE-13762
---
 modules/rostests/winetests/msi/db.c  |   6 +
 modules/rostests/winetests/msi/format.c  |  63 +++
 modules/rostests/winetests/msi/msi.c |  18 +
 modules/rostests/winetests/msi/package.c | 807 ++-
 modules/rostests/winetests/msi/record.c  |  19 +-
 5 files changed, 893 insertions(+), 20 deletions(-)

diff --git a/modules/rostests/winetests/msi/db.c 
b/modules/rostests/winetests/msi/db.c
index 278b45f958..4ea1f10024 100644
--- a/modules/rostests/winetests/msi/db.c
+++ b/modules/rostests/winetests/msi/db.c
@@ -2369,6 +2369,12 @@ static void test_msiimport(void)
 r = MsiOpenDatabaseW(msifileW, MSIDBOPEN_CREATE, );
 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
 
+r = MsiDatabaseImportA(hdb, CURR_DIR, NULL);
+ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got 
%d\n", r);
+
+r = MsiDatabaseImportA(hdb, CURR_DIR, "nonexistent");
+ok(r == ERROR_FUNCTION_FAILED, "Expected ERROR_FUNCTION_FAILED, got %d\n", 
r);
+
 r = add_table_to_db(hdb, test_data);
 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
 
diff --git a/modules/rostests/winetests/msi/format.c 
b/modules/rostests/winetests/msi/format.c
index 8ed4bbbc6e..b476c6b290 100644
--- a/modules/rostests/winetests/msi/format.c
+++ b/modules/rostests/winetests/msi/format.c
@@ -494,6 +494,15 @@ static void test_formatrecord(void)
 ok( sz == 7, "size wrong\n");
 ok( 0 == strcmp(buffer,"boo hoo"), "wrong output\n");
 
+/* self-referential format field */
+r = MsiRecordSetStringA(hrec, 0, "[1] test [0]");
+ok( r == ERROR_SUCCESS, "set string failed\n");
+sz = sizeof buffer;
+r = MsiFormatRecordA(0, hrec, buffer, );
+ok( r == ERROR_SUCCESS, "format failed\n");
+ok( sz == 21, "size wrong\n");
+ok( 0 == strcmp(buffer,"boo test [1] test [0]"), "wrong output\n");
+
 /* empty string */
 r = MsiRecordSetStringA(hrec, 0, "");
 ok( r == ERROR_SUCCESS, "set string failed\n");
@@ -504,6 +513,18 @@ static void test_formatrecord(void)
 ok( 0 == strcmp(buffer,"1: boo 2: hoo 3:  4:  5:  6:  "), 
 "wrong output(%s)\n",buffer);
 
+/* empty string with numbers */
+r = MsiRecordSetStringA(hrec, 1, "123");
+ok( r == ERROR_SUCCESS, "set string failed\n");
+r = MsiRecordSetInteger(hrec, 2, 4567);
+ok( r == ERROR_SUCCESS, "set string failed\n");
+sz = sizeof buffer;
+r = MsiFormatRecordA(0, hrec, buffer, );
+ok( r == ERROR_SUCCESS, "format failed\n");
+ok( sz == 31, "size wrong %i\n",sz);
+ok( 0 == strcmp(buffer,"1: 123 2: 4567 3:  4:  5:  6:  "),
+"wrong output(%s)\n",buffer);
+
 /* play games with recursive lookups */
 r = MsiRecordSetStringA(hrec, 0, "[[1]] [2]");
 ok( r == ERROR_SUCCESS, "set string failed\n");
@@ -2575,6 +2596,12 @@ static void test_formatrecord_tables(void)
 ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
 ok( !lstrcmpA( buf, "1: ringer " ), "Expected '1: ringer ', got %s\n", buf 
);
 
+size = MAX_PATH;
+MsiRecordSetStringA( hrec, 0, "1: [1] " );
+r = MsiFormatRecordA( hpkg, hrec, buf,  );
+ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
+ok( !lstrcmpA( buf, "1: ringer " ), "Expected '1: ringer ', got %s\n", buf 
);
+
 /* environment variable doesn't exist */
 size = MAX_PATH;
 MsiRecordSetStringA( hrec, 1, "[%idontexist]" );
@@ -2777,6 +2804,42 @@ static void test_processmessage(void)
 r = MsiProcessMessage(package, INSTALLMESSAGE_ACTIONSTART, hrec);
 ok( r == IDOK, "expected IDOK, got %i\n", r);
 
+r = MsiProcessMessage(package, INSTALLMESSAGE_PROGRESS, hrec);
+ok( r == IDOK, "expected IDOK, got %i\n", r);
+
+r = MsiProcessMessage(package, INSTALLMESSAGE_INFO, hrec);
+ok( r == 0, "expected 0, got %i\n", r);
+
+r = MsiProcessMessage(package, INSTALLMESSAGE_INITIALIZE, hrec);
+ok( r == -1, "expected -1, got %i\n", r);
+
+r = MsiRecordSetInteger(hrec, 1, 2);
+ok( r == ERROR_SUCCESS, "set integer failed\n");
+r = MsiRecordSetInteger(hrec, 2, 1);
+ok( r == ERROR_SUCCESS, "set integer failed\n");
+r = MsiProcessMessage(package, INSTALLMESSAGE_COMMONDATA, hrec);
+todo_wine
+ok( r == IDOK, "expected IDOK, got %i\n", r);
+
+r = MsiRecordSetInteger(hrec, 2, 2);
+ok( r == ERROR_SUCCESS, "set integer failed\n");
+r = MsiProcessMessage(package, INSTALLMESSAGE_COMMONDATA, hrec);
+todo_wine
+ok( r == IDOK, "expected IDOK, got %i\n", r);
+
+r = MsiRecordSetInteger(hrec, 1, 1);
+ok( r == ERROR_SUCCESS, "set integer failed\n");
+r = MsiProcessMessage(package, 

[ros-diffs] [reactos] 01/03: [PSDK] Update msi.h. CORE-13762

2017-10-08 Thread Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=154006810e4a1b014550a0b35b02bb1fabb88242

commit 154006810e4a1b014550a0b35b02bb1fabb88242
Author: Amine Khaldi 
AuthorDate: Sun Oct 8 09:10:16 2017 +0100

[PSDK] Update msi.h. CORE-13762
---
 sdk/include/psdk/msi.h | 19 +--
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/sdk/include/psdk/msi.h b/sdk/include/psdk/msi.h
index 58a1eb2c5e..84386c5ec4 100644
--- a/sdk/include/psdk/msi.h
+++ b/sdk/include/psdk/msi.h
@@ -105,7 +105,10 @@ typedef enum tagINSTALLMESSAGE
 INSTALLMESSAGE_COMMONDATA = 0x0b00,
 INSTALLMESSAGE_INITIALIZE = 0x0c00,
 INSTALLMESSAGE_TERMINATE = 0x0d00,
-INSTALLMESSAGE_SHOWDIALOG = 0x0e00
+INSTALLMESSAGE_SHOWDIALOG = 0x0e00,
+INSTALLMESSAGE_RMFILESINUSE = 0x1900,
+INSTALLMESSAGE_INSTALLSTART = 0x1A00,
+INSTALLMESSAGE_INSTALLEND = 0x1B00,
 } INSTALLMESSAGE;
 
 typedef enum tagREINSTALLMODE
@@ -130,18 +133,22 @@ typedef enum tagINSTALLLOGMODE
 INSTALLLOGMODE_WARNING= (1 << (INSTALLMESSAGE_WARNING >> 24)),
 INSTALLLOGMODE_USER   = (1 << (INSTALLMESSAGE_USER >> 24)),
 INSTALLLOGMODE_INFO   = (1 << (INSTALLMESSAGE_INFO >> 24)),
+INSTALLLOGMODE_FILESINUSE = (1 << (INSTALLMESSAGE_FILESINUSE >> 24)),
 INSTALLLOGMODE_RESOLVESOURCE  = (1 << (INSTALLMESSAGE_RESOLVESOURCE >> 
24)),
 INSTALLLOGMODE_OUTOFDISKSPACE = (1 << (INSTALLMESSAGE_OUTOFDISKSPACE >> 
24)),
 INSTALLLOGMODE_ACTIONSTART= (1 << (INSTALLMESSAGE_ACTIONSTART >> 24)),
 INSTALLLOGMODE_ACTIONDATA = (1 << (INSTALLMESSAGE_ACTIONDATA >> 24)),
-INSTALLLOGMODE_COMMONDATA = (1 << (INSTALLMESSAGE_COMMONDATA >> 24)),
-INSTALLLOGMODE_PROPERTYDUMP   = (1 << (INSTALLMESSAGE_PROGRESS >> 24)),
-INSTALLLOGMODE_VERBOSE= (1 << (INSTALLMESSAGE_INITIALIZE >> 24)),
-INSTALLLOGMODE_EXTRADEBUG = (1 << (INSTALLMESSAGE_TERMINATE >> 24)),
 INSTALLLOGMODE_PROGRESS   = (1 << (INSTALLMESSAGE_PROGRESS >> 24)),
+INSTALLLOGMODE_PROPERTYDUMP   = (1 << (INSTALLMESSAGE_PROGRESS >> 24)),
+INSTALLLOGMODE_COMMONDATA = (1 << (INSTALLMESSAGE_COMMONDATA >> 24)),
 INSTALLLOGMODE_INITIALIZE = (1 << (INSTALLMESSAGE_INITIALIZE >> 24)),
+INSTALLLOGMODE_VERBOSE= (1 << (INSTALLMESSAGE_INITIALIZE >> 24)),
 INSTALLLOGMODE_TERMINATE  = (1 << (INSTALLMESSAGE_TERMINATE >> 24)),
-INSTALLLOGMODE_SHOWDIALOG = (1 << (INSTALLMESSAGE_SHOWDIALOG >> 24))
+INSTALLLOGMODE_EXTRADEBUG = (1 << (INSTALLMESSAGE_TERMINATE >> 24)),
+INSTALLLOGMODE_SHOWDIALOG = (1 << (INSTALLMESSAGE_SHOWDIALOG >> 24)),
+INSTALLLOGMODE_RMFILESINUSE   = (1 << (INSTALLMESSAGE_RMFILESINUSE >> 24)),
+INSTALLLOGMODE_INSTALLSTART   = (1 << (INSTALLMESSAGE_INSTALLSTART >> 24)),
+INSTALLLOGMODE_INSTALLEND = (1 << (INSTALLMESSAGE_INSTALLEND >> 24)),
 } INSTALLLOGMODE;
 
 typedef enum tagINSTALLLOGATTRIBUTES



[ros-diffs] [reactos] 01/01: [WDMAUD] Close mixers on cleanup. Should fix CORE-10735 definitely (#21)

2017-10-08 Thread Sylvain Deverre
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c51df789e869379a515d94c66da152c5b26660ff

commit c51df789e869379a515d94c66da152c5b26660ff
Author: Sylvain Deverre 
AuthorDate: Sun Oct 8 11:29:17 2017 +0200

[WDMAUD] Close mixers on cleanup. Should fix CORE-10735 definitely (#21)

[WDMAUD] Close mixers on cleanup. CORE-10735
---
 drivers/wdm/audio/legacy/wdmaud/entry.c  |  1 +
 drivers/wdm/audio/legacy/wdmaud/mmixer.c | 30 +-
 drivers/wdm/audio/legacy/wdmaud/wdmaud.h |  6 ++
 3 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/drivers/wdm/audio/legacy/wdmaud/entry.c 
b/drivers/wdm/audio/legacy/wdmaud/entry.c
index ee304845bb..eede79172d 100644
--- a/drivers/wdm/audio/legacy/wdmaud/entry.c
+++ b/drivers/wdm/audio/legacy/wdmaud/entry.c
@@ -326,6 +326,7 @@ WdmAudCleanup(
/* found an still open audio pin */
ZwClose(pClient->hPins[Index].Handle);
}
+   WdmAudCloseAllMixers(DeviceObject, pClient, Index);
 }
 
 /* free pin array */
diff --git a/drivers/wdm/audio/legacy/wdmaud/mmixer.c 
b/drivers/wdm/audio/legacy/wdmaud/mmixer.c
index 9887d0974a..3016d24c67 100644
--- a/drivers/wdm/audio/legacy/wdmaud/mmixer.c
+++ b/drivers/wdm/audio/legacy/wdmaud/mmixer.c
@@ -480,7 +480,7 @@ WdmAudControlCloseMixer(
 IN  ULONG Index)
 {
 /* Remove event associated to this client */
-if (MMixerClose(, DeviceInfo->DeviceIndex, ClientInfo, 
EventCallback))
+if (MMixerClose(, DeviceInfo->DeviceIndex, ClientInfo, 
EventCallback) != MM_STATUS_SUCCESS)
 {
 DPRINT1("Failed to close mixer\n");
 return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 
sizeof(WDMAUD_DEVICE_INFO));
@@ -497,6 +497,34 @@ WdmAudControlCloseMixer(
 return SetIrpIoStatus(Irp, STATUS_SUCCESS, sizeof(WDMAUD_DEVICE_INFO));
 }
 
+VOID
+WdmAudCloseAllMixers(
+IN PDEVICE_OBJECT DeviceObject,
+IN PWDMAUD_CLIENT ClientInfo,
+IN ULONG Index)
+{
+ULONG DeviceCount, DeviceIndex;
+
+/* Get all mixers */
+DeviceCount = GetSysAudioDeviceCount(DeviceObject);
+
+/* Close every mixer attached to the device */
+for (DeviceIndex = 0; DeviceIndex < DeviceCount; DeviceIndex++)
+{
+if (MMixerClose(, DeviceIndex, ClientInfo, EventCallback) 
!= MM_STATUS_SUCCESS)
+{
+DPRINT1("Failed to close mixer for device %lu\n", DeviceIndex);
+}
+}
+
+/* Dereference event */
+if (ClientInfo->hPins[Index].NotifyEvent)
+{
+ObDereferenceObject(ClientInfo->hPins[Index].NotifyEvent);
+ClientInfo->hPins[Index].NotifyEvent = NULL;
+}
+}
+
 NTSTATUS
 NTAPI
 WdmAudGetControlDetails(
diff --git a/drivers/wdm/audio/legacy/wdmaud/wdmaud.h 
b/drivers/wdm/audio/legacy/wdmaud/wdmaud.h
index 04d8975b9a..49f01f2fbd 100644
--- a/drivers/wdm/audio/legacy/wdmaud/wdmaud.h
+++ b/drivers/wdm/audio/legacy/wdmaud/wdmaud.h
@@ -136,6 +136,12 @@ WdmAudControlCloseMixer(
 IN  PWDMAUD_CLIENT ClientInfo,
 IN  ULONG Index);
 
+VOID
+WdmAudCloseAllMixers(
+IN PDEVICE_OBJECT DeviceObject,
+IN PWDMAUD_CLIENT ClientInfo,
+IN ULONG Index);
+
 NTSTATUS
 WdmAudControlOpenWave(
 IN  PDEVICE_OBJECT DeviceObject,



[ros-diffs] [reactos] 01/01: [KERNEL32_APITEST]: Add tests for IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME that show its usage is "one-shot". Once queried, it gets forgotten.

2017-10-08 Thread Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d788a52c79f5822cc8a21920de421b77519ebd94

commit d788a52c79f5822cc8a21920de421b77519ebd94
Author: Pierre Schweitzer 
AuthorDate: Sun Oct 8 10:12:08 2017 +0200

[KERNEL32_APITEST]: Add tests for IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME 
that show its usage is "one-shot". Once queried, it gets forgotten.
---
 .../rostests/apitests/kernel32/DeviceIoControl.c   | 37 ++
 1 file changed, 37 insertions(+)

diff --git a/modules/rostests/apitests/kernel32/DeviceIoControl.c 
b/modules/rostests/apitests/kernel32/DeviceIoControl.c
index faa10d5465..be3086edda 100644
--- a/modules/rostests/apitests/kernel32/DeviceIoControl.c
+++ b/modules/rostests/apitests/kernel32/DeviceIoControl.c
@@ -183,6 +183,42 @@ QueryUniqueId(VOID)
 HeapFree(GetProcessHeap(), 0, AllocatedMUI);
 }
 
+static
+VOID
+QuerySuggestedLinkName(VOID)
+{
+UINT Ret;
+DWORD Size, Error;
+MOUNTDEV_SUGGESTED_LINK_NAME MSLN;
+
+Size = 0;
+Ret = DeviceIoControl(Device, IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME, 
NULL, 0, , sizeof(MSLN) - 1, , NULL);
+ok_type(Ret == 0, "DeviceIoControl succeed\n");
+Error = GetLastError();
+if (DriveType == DRIVE_FIXED)
+{
+ok_type(Error == ERROR_INVALID_PARAMETER, "Expecting 
ERROR_INVALID_PARAMETER, got %ld\n", Error);
+}
+else
+{
+ok_type(Error == ERROR_INSUFFICIENT_BUFFER, "Expecting 
ERROR_INSUFFICIENT_BUFFER, got %ld\n", Error);
+}
+ok_type(Size == 0, "Invalid output size: %ld\n", Size);
+
+Ret = DeviceIoControl(Device, IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME, 
NULL, 0, , sizeof(MSLN), , NULL);
+ok_type(Ret == 0, "DeviceIoControl succeed\n");
+Error = GetLastError();
+if (DriveType == DRIVE_FIXED)
+{
+ok_type(Error == ERROR_NOT_FOUND, "Expecting ERROR_NOT_FOUND, got 
%ld\n", Error);
+}
+else
+{
+ok_type(Error == ERROR_FILE_NOT_FOUND, "Expecting 
ERROR_FILE_NOT_FOUND, got %ld\n", Error);
+}
+ok_type(Size == 0, "Invalid output size: %ld\n", Size);
+}
+
 START_TEST(DeviceIoControl)
 {
 UINT Ret;
@@ -221,6 +257,7 @@ START_TEST(DeviceIoControl)
 {
 QueryDeviceName();
 QueryUniqueId();
+QuerySuggestedLinkName();
 }
 
 CloseHandle(Device);