[Mingw-w64-public] [PATCH] Add missing members into MINIDUMP_TYPE

2021-05-30 Thread Ruslan Garipov

Signed-off-by: Ruslan Garipov 
---
 mingw-w64-headers/include/psdk_inc/_dbg_common.h | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)



diff --git a/mingw-w64-headers/include/psdk_inc/_dbg_common.h b/mingw-w64-headers/include/psdk_inc/_dbg_common.h
index 48f2b9d7d..c42da025c 100644
--- a/mingw-w64-headers/include/psdk_inc/_dbg_common.h
+++ b/mingw-w64-headers/include/psdk_inc/_dbg_common.h
@@ -1531,7 +1531,13 @@ typedef struct _MINIDUMP_MEMORY_INFO_LIST {
 MiniDumpWithFullAuxiliaryState   = 0x8000,
 MiniDumpWithPrivateWriteCopyMemory   = 0x0001,
 MiniDumpIgnoreInaccessibleMemory = 0x0002,
-MiniDumpWithTokenInformation = 0x0004
+MiniDumpWithTokenInformation = 0x0004,
+MiniDumpWithModuleHeaders= 0x0008,
+MiniDumpFilterTriage = 0x0010,
+MiniDumpWithAvxXStateContext = 0x0020,
+MiniDumpWithIptTrace = 0x0040,
+MiniDumpScanInaccessiblePartialPages = 0x0080,
+MiniDumpValidTypeFlags   = 0x00ff
   } MINIDUMP_TYPE;
 
 #define MINIDUMP_THREAD_INFO_ERROR_THREAD0x0001


___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] Add missing members into MINIDUMP_TYPE

2021-05-29 Thread Ruslan Garipov

Signed-off-by: Ruslan Garipov 
---
 mingw-w64-headers/include/psdk_inc/_dbg_common.h | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)


diff --git a/mingw-w64-headers/include/psdk_inc/_dbg_common.h b/mingw-w64-headers/include/psdk_inc/_dbg_common.h
index 48f2b9d7d..4018bad8c 100644
--- a/mingw-w64-headers/include/psdk_inc/_dbg_common.h
+++ b/mingw-w64-headers/include/psdk_inc/_dbg_common.h
@@ -1531,7 +1531,13 @@ typedef struct _MINIDUMP_MEMORY_INFO_LIST {
 MiniDumpWithFullAuxiliaryState   = 0x8000,
 MiniDumpWithPrivateWriteCopyMemory   = 0x0001,
 MiniDumpIgnoreInaccessibleMemory = 0x0002,
-MiniDumpWithTokenInformation = 0x0004
+MiniDumpWithTokenInformation = 0x0004,
+MiniDumpWithModuleHeaders= 0x0008,
+MiniDumpFilterTriage = 0x0010,
+MiniDumpWithAvxXStateContext = 0x0020,
+MiniDumpWithIptTrace = 0x0040,
+MiniDumpScanInaccessiblePartialPages = 0x0080,
+MiniDumpValidTypeFlags   = 0x00ff,
   } MINIDUMP_TYPE;
 
 #define MINIDUMP_THREAD_INFO_ERROR_THREAD0x0001

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PING] [PATCH] dwrite_1.h: Fix build in C mode

2020-06-14 Thread Ruslan Garipov

Some classes† in the file declare overloaded functions, and this causes
a C compiler to fail on module including dwrite_1.h.  This commit fixes
that.

To be consistent on changes I rewrote declaration of all classes/structs
in the file, even if one doesn't use overloaded functions.

No changes for compilation using C++ mode.

† IDWriteFont1, IDWriteFontFace1 and IDWriteFactory1.

Signed-off-by: ‡Ruslan Garipov 
---
  mingw-w64-headers/include/dwrite_1.h | 1027 ++
  1 file changed, 373 insertions(+), 654 deletions(-)



diff --git a/mingw-w64-headers/include/dwrite_1.h b/mingw-w64-headers/include/dwrite_1.h
index 52de1fc75b..527c80f428 100644
--- a/mingw-w64-headers/include/dwrite_1.h
+++ b/mingw-w64-headers/include/dwrite_1.h
@@ -9,6 +9,51 @@
 
 #include 
 
+#ifndef __IDWriteFont1_FWD_DEFINED__
+#define __IDWriteFont1_FWD_DEFINED__
+typedef struct IDWriteFont1 IDWriteFont1;
+#endif
+
+#ifndef __IDWriteFontFace1_FWD_DEFINED__
+#define __IDWriteFontFace1_FWD_DEFINED__
+typedef struct IDWriteFontFace1 IDWriteFontFace1;
+#endif
+
+#ifndef __IDWriteRenderingParams1_FWD_DEFINED__
+#define __IDWriteRenderingParams1_FWD_DEFINED__
+typedef struct IDWriteRenderingParams1 IDWriteRenderingParams1;
+#endif
+
+#ifndef __IDWriteTextAnalysisSource1_FWD_DEFINED__
+#define __IDWriteTextAnalysisSource1_FWD_DEFINED__
+typedef struct IDWriteTextAnalysisSource1 IDWriteTextAnalysisSource1;
+#endif
+
+#ifndef __IDWriteTextAnalysisSink1_FWD_DEFINED__
+#define __IDWriteTextAnalysisSink1_FWD_DEFINED__
+typedef struct IDWriteTextAnalysisSink1 IDWriteTextAnalysisSink1;
+#endif
+
+#ifndef __IDWriteTextAnalyzer1_FWD_DEFINED__
+#define __IDWriteTextAnalyzer1_FWD_DEFINED__
+typedef struct IDWriteTextAnalyzer1 IDWriteTextAnalyzer1;
+#endif
+
+#ifndef __IDWriteTextLayout1_FWD_DEFINED__
+#define __IDWriteTextLayout1_FWD_DEFINED__
+typedef struct IDWriteTextLayout1 IDWriteTextLayout1;
+#endif
+
+#ifndef __IDWriteFactory1_FWD_DEFINED__
+#define __IDWriteFactory1_FWD_DEFINED__
+typedef struct IDWriteFactory1 IDWriteFactory1;
+#endif
+
+#ifndef __IDWriteBitmapRenderTarget1_FWD_DEFINED__
+#define __IDWriteBitmapRenderTarget1_FWD_DEFINED__
+typedef struct IDWriteBitmapRenderTarget1 IDWriteBitmapRenderTarget1;
+#endif
+
 enum DWRITE_OUTLINE_THRESHOLD {
 DWRITE_OUTLINE_THRESHOLD_ANTIALIASED,
 DWRITE_OUTLINE_THRESHOLD_ALIASED
@@ -173,393 +218,338 @@ union DWRITE_PANOSE {
 } symbol;
 };
 
+#ifndef D2D_USE_C_DEFINITIONS
+
 #undef  INTERFACE
 #define INTERFACE IDWriteFont1
 DECLARE_INTERFACE_(IDWriteFont1,IDWriteFont)
 {
 BEGIN_INTERFACE
 
-#ifndef __cplusplus
-/* IUnknown methods */
-STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
-STDMETHOD_(ULONG, AddRef)(THIS) PURE;
-STDMETHOD_(ULONG, Release)(THIS) PURE;
-
-/* IDWriteFont methods */
-STDMETHOD(GetFontFamily)(THIS_
-IDWriteFontFamily **fontFamily) PURE;
-
-STDMETHOD_(DWRITE_FONT_WEIGHT, GetWeight)(THIS) PURE;
-STDMETHOD_(DWRITE_FONT_STRETCH, GetStretch)(THIS) PURE;
-STDMETHOD_(DWRITE_FONT_STYLE, GetStyle)(THIS) PURE;
-STDMETHOD_(WINBOOL, IsSymbolFont)(THIS) PURE;
+STDMETHOD_(void, GetMetrics)(DWRITE_FONT_METRICS1 *fontMetrics) PURE;
 
-STDMETHOD(GetFaceNames)(THIS_
-IDWriteLocalizedStrings **names) PURE;
+STDMETHOD_(void, GetPanose)(DWRITE_PANOSE *panose) PURE;
 
-STDMETHOD(GetInformationalStrings)(THIS_
-DWRITE_INFORMATIONAL_STRING_ID informationalStringID,
-IDWriteLocalizedStrings **informationalStrings,
-WINBOOL *exists) PURE;
-
-STDMETHOD_(DWRITE_FONT_SIMULATIONS, GetSimulations)(THIS) PURE;
+STDMETHOD(GetUnicodeRanges)(UINT32 maxCount,
+DWRITE_UNICODE_RANGE *ranges,
+UINT32 *actualCount) PURE;
 
-STDMETHOD_(void, GetMetrics)(THIS_
-DWRITE_FONT_METRICS *fontMetrics) PURE;
+END_INTERFACE
+};
 
-STDMETHOD(HasCharacter)(THIS_
-UINT32 unicodeValue,
-WINBOOL *exists) PURE;
+#else  /* D2D_USE_C_DEFINITIONS */
 
-STDMETHOD(CreateFontFace)(THIS_
-IDWriteFontFace **fontFace) PURE;
-#endif
+typedef struct IDWriteFont1Vtbl
+{
+IDWriteFontVtbl Base;
 
-STDMETHOD_(void, GetMetrics)(THIS_
-DWRITE_FONT_METRICS1 *fontMetrics) PURE;
+STDMETHOD_(void, GetMetrics)(IDWriteFont1 *This,
+struct DWRITE_FONT_METRICS1 *fontMetrics) PURE;
 
-STDMETHOD_(void, GetPanose)(THIS_
-DWRITE_PANOSE *panose) PURE;
+STDMETHOD_(void, GetPanose)(IDWriteFont1 *This,
+union DWRITE_PANOSE *panose) PURE;
 
-STDMETHOD(GetUnicodeRanges)(THIS_
+STDMETHOD(GetUnicodeRanges)(IDWriteFont1 *This,
 UINT32 maxCount,
-DWRITE_UNICODE_RANGE *ranges,
+struct DWRITE_UNICODE_RANGE *ranges,
 UINT32 *actualCount) PURE;
+}
+IDWriteFont1Vtbl;
 
-END_INTERFACE
+interface IDWriteFont1
+{
+const IDWriteFont1Vtbl *lpVtbl;
 };
 
+#endif  /* D2D_USE_C_DEFINITIONS */
+
 __CRT_UUID_DECL(IDWriteFont1, 0xacd16696,0x8c14,0x4f5d,0x87,0x7e,0xfe

[Mingw-w64-public] [PING] [PATCH] d2d1_1.h: Add C declaration for ID2D1Multithread

2020-06-14 Thread Ruslan Garipov

Signed-off-by: ‡Ruslan Garipov 
---
  mingw-w64-headers/include/d2d1_1.h | 20 +++-
  1 file changed, 19 insertions(+), 1 deletion(-)



diff --git a/mingw-w64-headers/include/d2d1_1.h b/mingw-w64-headers/include/d2d1_1.h
index 5c97245dcf..a4b710f0c2 100644
--- a/mingw-w64-headers/include/d2d1_1.h
+++ b/mingw-w64-headers/include/d2d1_1.h
@@ -1068,7 +1068,25 @@ interface ID2D1Multithread : public IUnknown
 #else
 
 typedef interface ID2D1Multithread ID2D1Multithread;
-/* FIXME: Add full C declaration */
+
+typedef struct ID2D1MultithreadVtbl {
+IUnknownVtbl Base;
+
+STDMETHOD_(BOOL, GetMultithreadProtected)(ID2D1Multithread *This) PURE;
+STDMETHOD_(void, Enter)(ID2D1Multithread *This) PURE;
+STDMETHOD_(void, Leave)(ID2D1Multithread *This) PURE;
+} ID2D1MultithreadVtbl;
+
+interface ID2D1Multithread {
+ID2D1MultithreadVtbl *lpVtbl;
+};
+
+#define ID2D1Multithread_QueryInterface(this,A,B) (this)->lpVtbl->Base.QueryInterface((IUnknown *)(this),A,B)
+#define ID2D1Multithread_AddRef(this) (this)->lpVtbl->Base.AddRef((IUnknown *)(this))
+#define ID2D1Multithread_Release(this) (this)->lpVtbl->Base.Release((IUnknown *)(this))
+#define ID2D1Mutlithread_GetMultithreadProtected(this) (this)->lpVtbl->GetMultihreadProtected(this)
+#define ID2D1Multithread_Enter(this) (this)->lpVtbl->Enter(this)
+#define ID2D1Multithread_Leave(this) (this)->lpVtbl->Leave(this)
 
 #endif
 


___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] d2d1_1.h: Add C declaration for ID2D1Bitmap1

2020-05-21 Thread Ruslan Garipov


Signed-off-by: ‡Ruslan Garipov 
---
 mingw-w64-headers/include/d2d1_1.h | 15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)


diff --git a/mingw-w64-headers/include/d2d1_1.h b/mingw-w64-headers/include/d2d1_1.h
index f48ac349cd..747ab68a10 100644
--- a/mingw-w64-headers/include/d2d1_1.h
+++ b/mingw-w64-headers/include/d2d1_1.h
@@ -564,8 +564,21 @@ interface ID2D1Bitmap1 : public ID2D1Bitmap
 #else
 
 typedef interface ID2D1Bitmap1 ID2D1Bitmap1;
-/* FIXME: Add full C declaration */
 
+typedef struct ID2D1Bitmap1Vtbl {
+ID2D1BitmapVtbl Base;
+
+STDMETHOD_(void, GetColorContext)(ID2D1Bitmap1 *This, ID2D1ColorContext **colorContext) PURE;
+STDMETHOD_(D2D1_BITMAP_OPTIONS, GetOptions)(ID2D1Bitmap1 *This) PURE;
+STDMETHOD(GetSurface)(ID2D1Bitmap1 *This, IDXGISurface **dxgiSurface) PURE;
+STDMETHOD(Map)(ID2D1Bitmap1 *This, D2D1_MAP_OPTIONS options, D2D1_MAPPED_RECT *mappedRect) PURE;
+STDMETHOD(Unmap)(ID2D1Bitmap1 *This) PURE;
+}
+ID2D1Bitmap1Vtbl;
+
+interface ID2D1Bitmap1 {
+const ID2D1Bitmap1Vtbl *lpVtbl;
+};
 #endif
 
 DEFINE_GUID(IID_ID2D1Bitmap1, 0xa898a84c,0x3873,0x4588,0xb0,0x8b,0xeb,0xbf,0x97,0x8d,0xf0,0x41);

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH 1/2] d2d1_1.h: Add C declaration for ID2D1DeviceContext

2020-05-19 Thread Ruslan Garipov


Signed-off-by: ‡Ruslan Garipov 
---
 mingw-w64-headers/include/d2d1_1.h | 125 -
 1 file changed, 124 insertions(+), 1 deletion(-)


diff --git a/mingw-w64-headers/include/d2d1_1.h b/mingw-w64-headers/include/d2d1_1.h
index 5c97245dcf..f090be7ac0 100644
--- a/mingw-w64-headers/include/d2d1_1.h
+++ b/mingw-w64-headers/include/d2d1_1.h
@@ -864,7 +864,130 @@ interface ID2D1DeviceContext : public ID2D1RenderTarget
 #else
 
 typedef interface ID2D1DeviceContext ID2D1DeviceContext;
-/* FIXME: Add full C declaration */
+
+typedef struct ID2D1DeviceContextVtbl {
+struct ID2D1RenderTargetVtbl Base;
+
+STDMETHOD(CreateBitmap)(ID2D1DeviceContext *This, D2D1_SIZE_U size,
+CONST void *sourceData, UINT32 pitch,
+CONST D2D1_BITMAP_PROPERTIES1 *bitmapProperties,
+ID2D1Bitmap1 **bitmap) PURE;
+
+STDMETHOD(CreateBitmapFromWicBitmap)(ID2D1DeviceContext *This,
+IWICBitmapSource *wicBitmapSource,
+CONST D2D1_BITMAP_PROPERTIES1 *bitmapProperties,
+ID2D1Bitmap1 **bitmap) PURE;
+
+STDMETHOD(CreateColorContext)(ID2D1DeviceContext *This,
+D2D1_COLOR_SPACE space, CONST BYTE *profile, UINT32 profileSize,
+ID2D1ColorContext **colorContext) PURE;
+STDMETHOD(CreateColorContextFromFilename)(ID2D1DeviceContext *This,
+PCWSTR filename, ID2D1ColorContext **colorContext) PURE;
+STDMETHOD(CreateColorContextFromWicColorContext)(ID2D1DeviceContext *This,
+IWICColorContext *wicColorContext,
+ID2D1ColorContext **colorContext) PURE;
+STDMETHOD(CreateBitmapFromDxgiSurface)(ID2D1DeviceContext *This,
+IDXGISurface *surface, CONST D2D1_BITMAP_PROPERTIES1 *bitmapProperties,
+ID2D1Bitmap1 **bitmap) PURE;
+STDMETHOD(CreateEffect)(ID2D1DeviceContext *This, REFCLSID effectId,
+ID2D1Effect **effect) PURE;
+
+STDMETHOD(CreateGradientStopCollection)(ID2D1DeviceContext *This,
+CONST D2D1_GRADIENT_STOP *straightAlphaGradientStops,
+UINT32 straightAlphaGradientStopsCount,
+D2D1_COLOR_SPACE preInterpolationSpace,
+D2D1_COLOR_SPACE postInterpolationSpace,
+D2D1_BUFFER_PRECISION bufferPrecision,
+D2D1_EXTEND_MODE extendMode,
+D2D1_COLOR_INTERPOLATION_MODE colorInterpolationMode,
+ID2D1GradientStopCollection1 **gradientStopCollection1) PURE;
+
+STDMETHOD(CreateImageBrush)(ID2D1DeviceContext *This,
+struct ID2D1Image *image,
+CONST D2D1_IMAGE_BRUSH_PROPERTIES *imageBrushProperties,
+CONST D2D1_BRUSH_PROPERTIES *brushProperties,
+ID2D1ImageBrush **imageBrush) PURE;
+
+STDMETHOD(CreateBitmapBrush)(ID2D1DeviceContext *This, ID2D1Bitmap *bitmap,
+CONST D2D1_BITMAP_BRUSH_PROPERTIES1 *bitmapBrushProperties,
+CONST D2D1_BRUSH_PROPERTIES *brushProperties,
+ID2D1BitmapBrush1 **bitmapBrush) PURE;
+
+STDMETHOD(CreateCommandList)(ID2D1DeviceContext *This,
+ID2D1CommandList **commandList) PURE;
+STDMETHOD_(BOOL, IsDxgiFormatSupported)(ID2D1DeviceContext *This,
+DXGI_FORMAT format) PURE;
+STDMETHOD_(BOOL, IsBufferPrecisionSupported)(ID2D1DeviceContext *This,
+D2D1_BUFFER_PRECISION bufferPrecision) PURE;
+STDMETHOD(GetImageLocalBounds)(ID2D1DeviceContext *This,
+struct ID2D1Image *image, D2D1_RECT_F *localBounds) PURE;
+STDMETHOD(GetImageWorldBounds)(ID2D1DeviceContext *This,
+struct ID2D1Image *image, D2D1_RECT_F *worldBounds) PURE;
+STDMETHOD(GetGlyphRunWorldBounds)(ID2D1DeviceContext *This,
+D2D1_POINT_2F baselineOrigin, CONST DWRITE_GLYPH_RUN *glyphRun,
+DWRITE_MEASURING_MODE measuringMode, D2D1_RECT_F *bounds) PURE;
+STDMETHOD_(void, GetDevice)(ID2D1DeviceContext *This,
+ID2D1Device **device) PURE;
+STDMETHOD_(void, SetTarget)(ID2D1DeviceContext *This,
+struct ID2D1Image *image) PURE;
+STDMETHOD_(void, GetTarget)(ID2D1DeviceContext *This,
+struct ID2D1Image **image) PURE;
+STDMETHOD_(void, SetRenderingControls)(ID2D1DeviceContext *This,
+CONST D2D1_RENDERING_CONTROLS *renderingControls) PURE;
+STDMETHOD_(void, GetRenderingControls)(ID2D1DeviceContext *This,
+D2D1_RENDERING_CONTROLS *renderingControls) PURE;
+STDMETHOD_(void, SetPrimitiveBlend)(ID2D1DeviceContext *This,
+D2D1_PRIMITIVE_BLEND primitiveBlend) PURE;
+STDMETHOD_(D2D1_PRIMITIVE_BLEND, GetPrimitiveBlend)(ID2D1DeviceContext *This) PURE;
+STDMETHOD_(void, SetUnitMode)(ID2D1DeviceContext *This,
+D2D1_UNIT_MODE unitMode) PURE;
+STDMETHOD_(D2D1_UNIT_MODE, GetUnitMode)(ID2D1DeviceContext *This) PURE;
+
+STDMETHOD_(void, DrawGlyphRun)(ID2D1DeviceContext *This,
+D2D1_POINT_2F baselineOrigin, CONST DWRITE_GLYPH_RUN *glyphRun,
+CONST DWRITE_GLYPH_RUN_DESCRIPTION *glyphRunDescription,
+ID2D1Brush *foregroundBrush, DWRITE_MEASURING_MODE measuringMode) PURE;
+
+STDMETHOD_(void, DrawImage)(ID2D1DeviceContext *This,
+struct

[Mingw-w64-public] [PATCH 2/2] d2d1_1.h: Add C declaration for ID2D1Device

2020-05-19 Thread Ruslan Garipov


Signed-off-by: ‡Ruslan Garipov 
---
 mingw-w64-headers/include/d2d1_1.h | 24 +++-
 1 file changed, 23 insertions(+), 1 deletion(-)


diff --git a/mingw-w64-headers/include/d2d1_1.h b/mingw-w64-headers/include/d2d1_1.h
index f090be7ac0..f48ac349cd 100644
--- a/mingw-w64-headers/include/d2d1_1.h
+++ b/mingw-w64-headers/include/d2d1_1.h
@@ -1014,7 +1014,29 @@ interface ID2D1Device : public ID2D1Resource
 #else
 
 typedef interface ID2D1Device ID2D1Device;
-/* FIXME: Add full C declaration */
+
+typedef struct ID2D1DeviceVtbl {
+struct ID2D1ResourceVtbl Base;
+
+STDMETHOD(CreateDeviceContext)(ID2D1Device *This,
+D2D1_DEVICE_CONTEXT_OPTIONS options,
+ID2D1DeviceContext **deviceContext) PURE;
+STDMETHOD(CreatePrintControl)(ID2D1Device *This,
+IWICImagingFactory *wicFactory,
+IPrintDocumentPackageTarget *documentTarget,
+CONST D2D1_PRINT_CONTROL_PROPERTIES *printControlProperties,
+ID2D1PrintControl **printControl) PURE;
+STDMETHOD_(void, SetMaximumTextureMemory)(ID2D1Device *This,
+UINT64 maximumInBytes) PURE;
+STDMETHOD_(UINT64, GetMaximumTextureMemory)(ID2D1Device *This) PURE;
+STDMETHOD_(void, ClearResources)(ID2D1Device *This,
+UINT32 millisecondsSinceUse) PURE;
+}
+ID2D1DeviceVtbl;
+
+interface ID2D1Device {
+const ID2D1DeviceVtbl *lpVtbl;
+};
 
 #endif
 

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] dwrite_1.h: Fix build in C mode

2020-05-18 Thread Ruslan Garipov


Some classes† in the file declare overloaded functions, and this causes
a C compiler to fail on module including dwrite_1.h.  This commit fixes
that.

To be consistent on changes I rewrote declaration of all classes/structs
in the file, even if one doesn't use overloaded functions.

No changes for compilation using C++ mode.

† IDWriteFont1, IDWriteFontFace1 and IDWriteFactory1.

Signed-off-by: ‡Ruslan Garipov 
---
 mingw-w64-headers/include/dwrite_1.h | 1027 ++
 1 file changed, 373 insertions(+), 654 deletions(-)


diff --git a/mingw-w64-headers/include/dwrite_1.h b/mingw-w64-headers/include/dwrite_1.h
index 52de1fc75b..527c80f428 100644
--- a/mingw-w64-headers/include/dwrite_1.h
+++ b/mingw-w64-headers/include/dwrite_1.h
@@ -9,6 +9,51 @@
 
 #include 
 
+#ifndef __IDWriteFont1_FWD_DEFINED__
+#define __IDWriteFont1_FWD_DEFINED__
+typedef struct IDWriteFont1 IDWriteFont1;
+#endif
+
+#ifndef __IDWriteFontFace1_FWD_DEFINED__
+#define __IDWriteFontFace1_FWD_DEFINED__
+typedef struct IDWriteFontFace1 IDWriteFontFace1;
+#endif
+
+#ifndef __IDWriteRenderingParams1_FWD_DEFINED__
+#define __IDWriteRenderingParams1_FWD_DEFINED__
+typedef struct IDWriteRenderingParams1 IDWriteRenderingParams1;
+#endif
+
+#ifndef __IDWriteTextAnalysisSource1_FWD_DEFINED__
+#define __IDWriteTextAnalysisSource1_FWD_DEFINED__
+typedef struct IDWriteTextAnalysisSource1 IDWriteTextAnalysisSource1;
+#endif
+
+#ifndef __IDWriteTextAnalysisSink1_FWD_DEFINED__
+#define __IDWriteTextAnalysisSink1_FWD_DEFINED__
+typedef struct IDWriteTextAnalysisSink1 IDWriteTextAnalysisSink1;
+#endif
+
+#ifndef __IDWriteTextAnalyzer1_FWD_DEFINED__
+#define __IDWriteTextAnalyzer1_FWD_DEFINED__
+typedef struct IDWriteTextAnalyzer1 IDWriteTextAnalyzer1;
+#endif
+
+#ifndef __IDWriteTextLayout1_FWD_DEFINED__
+#define __IDWriteTextLayout1_FWD_DEFINED__
+typedef struct IDWriteTextLayout1 IDWriteTextLayout1;
+#endif
+
+#ifndef __IDWriteFactory1_FWD_DEFINED__
+#define __IDWriteFactory1_FWD_DEFINED__
+typedef struct IDWriteFactory1 IDWriteFactory1;
+#endif
+
+#ifndef __IDWriteBitmapRenderTarget1_FWD_DEFINED__
+#define __IDWriteBitmapRenderTarget1_FWD_DEFINED__
+typedef struct IDWriteBitmapRenderTarget1 IDWriteBitmapRenderTarget1;
+#endif
+
 enum DWRITE_OUTLINE_THRESHOLD {
 DWRITE_OUTLINE_THRESHOLD_ANTIALIASED,
 DWRITE_OUTLINE_THRESHOLD_ALIASED
@@ -173,393 +218,338 @@ union DWRITE_PANOSE {
 } symbol;
 };
 
+#ifndef D2D_USE_C_DEFINITIONS
+
 #undef  INTERFACE
 #define INTERFACE IDWriteFont1
 DECLARE_INTERFACE_(IDWriteFont1,IDWriteFont)
 {
 BEGIN_INTERFACE
 
-#ifndef __cplusplus
-/* IUnknown methods */
-STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
-STDMETHOD_(ULONG, AddRef)(THIS) PURE;
-STDMETHOD_(ULONG, Release)(THIS) PURE;
-
-/* IDWriteFont methods */
-STDMETHOD(GetFontFamily)(THIS_
-IDWriteFontFamily **fontFamily) PURE;
-
-STDMETHOD_(DWRITE_FONT_WEIGHT, GetWeight)(THIS) PURE;
-STDMETHOD_(DWRITE_FONT_STRETCH, GetStretch)(THIS) PURE;
-STDMETHOD_(DWRITE_FONT_STYLE, GetStyle)(THIS) PURE;
-STDMETHOD_(WINBOOL, IsSymbolFont)(THIS) PURE;
+STDMETHOD_(void, GetMetrics)(DWRITE_FONT_METRICS1 *fontMetrics) PURE;
 
-STDMETHOD(GetFaceNames)(THIS_
-IDWriteLocalizedStrings **names) PURE;
+STDMETHOD_(void, GetPanose)(DWRITE_PANOSE *panose) PURE;
 
-STDMETHOD(GetInformationalStrings)(THIS_
-DWRITE_INFORMATIONAL_STRING_ID informationalStringID,
-IDWriteLocalizedStrings **informationalStrings,
-WINBOOL *exists) PURE;
-
-STDMETHOD_(DWRITE_FONT_SIMULATIONS, GetSimulations)(THIS) PURE;
+STDMETHOD(GetUnicodeRanges)(UINT32 maxCount,
+DWRITE_UNICODE_RANGE *ranges,
+UINT32 *actualCount) PURE;
 
-STDMETHOD_(void, GetMetrics)(THIS_
-DWRITE_FONT_METRICS *fontMetrics) PURE;
+END_INTERFACE
+};
 
-STDMETHOD(HasCharacter)(THIS_
-UINT32 unicodeValue,
-WINBOOL *exists) PURE;
+#else  /* D2D_USE_C_DEFINITIONS */
 
-STDMETHOD(CreateFontFace)(THIS_
-IDWriteFontFace **fontFace) PURE;
-#endif
+typedef struct IDWriteFont1Vtbl
+{
+IDWriteFontVtbl Base;
 
-STDMETHOD_(void, GetMetrics)(THIS_
-DWRITE_FONT_METRICS1 *fontMetrics) PURE;
+STDMETHOD_(void, GetMetrics)(IDWriteFont1 *This,
+struct DWRITE_FONT_METRICS1 *fontMetrics) PURE;
 
-STDMETHOD_(void, GetPanose)(THIS_
-DWRITE_PANOSE *panose) PURE;
+STDMETHOD_(void, GetPanose)(IDWriteFont1 *This,
+union DWRITE_PANOSE *panose) PURE;
 
-STDMETHOD(GetUnicodeRanges)(THIS_
+STDMETHOD(GetUnicodeRanges)(IDWriteFont1 *This,
 UINT32 maxCount,
-DWRITE_UNICODE_RANGE *ranges,
+struct DWRITE_UNICODE_RANGE *ranges,
 UINT32 *actualCount) PURE;
+}
+IDWriteFont1Vtbl;
 
-END_INTERFACE
+interface IDWriteFont1
+{
+const IDWriteFont1Vtbl *lpVtbl;
 };
 
+#endif  /* D2D_USE_C_DEFINITIONS */
+
 __CRT_UUID_DECL(IDWriteFont1, 0xacd16696,0x8c14,0x4f5d,0x87,0x7e,0xfe

Re: [Mingw-w64-public] [PATCH] d2d1_1.h: Add C declaration for ID2D1Multithread

2020-05-14 Thread Ruslan Garipov

On 5/14/2020 10:52 AM, Ruslan Garipov wrote:


Signed-off-by: ‡Ruslan Garipov 
---
  mingw-w64-headers/include/d2d1_1.h | 20 +++-
  1 file changed, 19 insertions(+), 1 deletion(-)


I discussed my changes applying to D2D/DirectWrite headers with
Biswapriyo Nath.  He will sent his patches to Wine first, and mingw-w64
will consume those patches then...  For now I provide my own patches
(made manually, not via IDL files) just to have the patches in the
mingw-w64 tree.  So I won't have to apply the patches locally.  Later,
the headers will be changed by ones patched by Biswapriyo (derived from
IDL files).


___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] d2d1_1.h: Add C declaration for ID2D1Multithread

2020-05-13 Thread Ruslan Garipov


Signed-off-by: ‡Ruslan Garipov 
---
 mingw-w64-headers/include/d2d1_1.h | 20 +++-
 1 file changed, 19 insertions(+), 1 deletion(-)


diff --git a/mingw-w64-headers/include/d2d1_1.h b/mingw-w64-headers/include/d2d1_1.h
index 5c97245dcf..a4b710f0c2 100644
--- a/mingw-w64-headers/include/d2d1_1.h
+++ b/mingw-w64-headers/include/d2d1_1.h
@@ -1068,7 +1068,25 @@ interface ID2D1Multithread : public IUnknown
 #else
 
 typedef interface ID2D1Multithread ID2D1Multithread;
-/* FIXME: Add full C declaration */
+
+typedef struct ID2D1MultithreadVtbl {
+IUnknownVtbl Base;
+
+STDMETHOD_(BOOL, GetMultithreadProtected)(ID2D1Multithread *This) PURE;
+STDMETHOD_(void, Enter)(ID2D1Multithread *This) PURE;
+STDMETHOD_(void, Leave)(ID2D1Multithread *This) PURE;
+} ID2D1MultithreadVtbl;
+
+interface ID2D1Multithread {
+ID2D1MultithreadVtbl *lpVtbl;
+};
+
+#define ID2D1Multithread_QueryInterface(this,A,B) (this)->lpVtbl->Base.QueryInterface((IUnknown *)(this),A,B)
+#define ID2D1Multithread_AddRef(this) (this)->lpVtbl->Base.AddRef((IUnknown *)(this))
+#define ID2D1Multithread_Release(this) (this)->lpVtbl->Base.Release((IUnknown *)(this))
+#define ID2D1Mutlithread_GetMultithreadProtected(this) (this)->lpVtbl->GetMultihreadProtected(this)
+#define ID2D1Multithread_Enter(this) (this)->lpVtbl->Enter(this)
+#define ID2D1Multithread_Leave(this) (this)->lpVtbl->Leave(this)
 
 #endif
 

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH 1/2] dwrite.h: Fix build in C mode

2020-05-08 Thread Ruslan Garipov
On 5/8/2020 3:32 PM, Biswapriyo Nath wrote:
> I will not discourage your effort and contribution. But if you want, this
> can be fixed easily with IDL files. widl will take care the rest. And IDL
> files are smaller to manage than their .h counterpart.
To be honest, it makes no difference for me who and how fixes a bug in
mingw-w64 :-)  Currently all I need is to build a C project which uses
D2D.  I can live fine with local patches applied to the header files,
but to make my life easier I've sent them here.

If I understand you correctly, you want to add IDL files, which will be
piped into widl, which will generate the header files from the input?
If, so, and the header files will be freed from that ``overloaded
functions bug'' for C mode, I don't care who will add the header files
into the mingw-w64 tree.  All I need is ``correct for C compiler''
header files within MSYS2's mingw-w64-x86_64-headers.

> 
> ___
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
> 


___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH 1/2] dwrite.h: Fix build in C mode

2020-05-08 Thread Ruslan Garipov


IDWriteTextLayout interface declares some overloaded member functions
(for example, IDWriteTextFormat::GetFontCollection and
IDWriteTextLayout::GetFontCollection).  This causes a C compiler to fail
on a module including dwrite.h.

This commit splits declaration of IDWriteTextLayout interface for C and
C++ "modes".  For C consumer the interface declares only its direct
members; to access the base class' ones code must use the Base member --
just like in interfaces declared in d2d1.h, for example.

While here, fix some IDWriteTextLayout_ COBJMACROS.

No changes for compilation using C++ mode.

Signed-off-by: ‡Ruslan Garipov 
---
 mingw-w64-headers/include/dwrite.h | 318 ++---
 1 file changed, 196 insertions(+), 122 deletions(-)


diff --git a/mingw-w64-headers/include/dwrite.h b/mingw-w64-headers/include/dwrite.h
index 943cd738ca..96bbf5514e 100644
--- a/mingw-w64-headers/include/dwrite.h
+++ b/mingw-w64-headers/include/dwrite.h
@@ -1899,200 +1899,258 @@ DECLARE_INTERFACE_(IDWriteTextFormat,IUnknown)
 #define IDWriteTextFormat_SetWordWrapping(This,wordWrapping) (This)->lpVtbl->SetWordWrapping(This,wordWrapping)
 #endif /*COBJMACROS*/
 
+#ifndef D2D_USE_C_DEFINITIONS
+
 #undef  INTERFACE
 #define INTERFACE IDWriteTextLayout
 DECLARE_INTERFACE_(IDWriteTextLayout,IDWriteTextFormat)
 {
 BEGIN_INTERFACE
 
-#ifndef __cplusplus
-/* IUnknown methods */
-STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
-STDMETHOD_(ULONG, AddRef)(THIS) PURE;
-STDMETHOD_(ULONG, Release)(THIS) PURE;
-
-/* IDWriteTextFormat methods */
-STDMETHOD(SetTextAlignment)(THIS_
-DWRITE_TEXT_ALIGNMENT textAlignment) PURE;
-STDMETHOD(SetParagraphAlignment)(THIS_
-DWRITE_PARAGRAPH_ALIGNMENT paragraphAlignment) PURE;
-STDMETHOD(SetWordWrapping)(THIS_
-DWRITE_WORD_WRAPPING wordWrapping) PURE;
-STDMETHOD(SetReadingDirection)(THIS_
-DWRITE_READING_DIRECTION readingDirection) PURE;
-STDMETHOD(SetFlowDirection)(THIS_
-DWRITE_FLOW_DIRECTION flowDirection) PURE;
-STDMETHOD(SetIncrementalTabStop)(THIS_
-FLOAT incrementalTabStop) PURE;
-STDMETHOD(SetTrimming)(THIS_
-DWRITE_TRIMMING const *trimmingOptions,
-IDWriteInlineObject *trimmingSign) PURE;
-STDMETHOD(SetLineSpacing)(THIS_
-DWRITE_LINE_SPACING_METHOD lineSpacingMethod,
-FLOAT lineSpacing,
-FLOAT baseline) PURE;
-STDMETHOD_(DWRITE_TEXT_ALIGNMENT, GetTextAlignment)(THIS) PURE;
-STDMETHOD_(DWRITE_PARAGRAPH_ALIGNMENT, GetParagraphAlignment)(THIS) PURE;
-STDMETHOD_(DWRITE_WORD_WRAPPING, GetWordWrapping)(THIS) PURE;
-STDMETHOD_(DWRITE_READING_DIRECTION, GetReadingDirection)(THIS) PURE;
-STDMETHOD_(DWRITE_FLOW_DIRECTION, GetFlowDirection)(THIS) PURE;
-STDMETHOD_(FLOAT, GetIncrementalTabStop)(THIS) PURE;
-STDMETHOD(GetTrimming)(THIS_
-DWRITE_TRIMMING* trimmingOptions,
-IDWriteInlineObject **trimmingSign) PURE;
-STDMETHOD(GetLineSpacing)(THIS_
-DWRITE_LINE_SPACING_METHOD *lineSpacingMethod,
-FLOAT *lineSpacing,
-FLOAT *baseline) PURE;
-STDMETHOD(GetFontCollection)(THIS_
-IDWriteFontCollection **fontCollection) PURE;
-STDMETHOD_(UINT32, GetFontFamilyNameLength)(THIS) PURE;
-STDMETHOD(GetFontFamilyName)(THIS_
+STDMETHOD(SetMaxWidth)(FLOAT maxWidth) PURE;
+STDMETHOD(SetMaxHeight)(FLOAT maxHeight) PURE;
+STDMETHOD(SetFontCollection)(IDWriteFontCollection *fontCollection,
+DWRITE_TEXT_RANGE textRange) PURE;
+STDMETHOD(SetFontFamilyName)(WCHAR const *fontFamilyName,
+DWRITE_TEXT_RANGE textRange) PURE;
+STDMETHOD(SetFontWeight)(DWRITE_FONT_WEIGHT fontWeight,
+DWRITE_TEXT_RANGE textRange) PURE;
+STDMETHOD(SetFontStyle)(DWRITE_FONT_STYLE fontStyle,
+DWRITE_TEXT_RANGE textRange) PURE;
+STDMETHOD(SetFontStretch)(DWRITE_FONT_STRETCH fontStretch,
+DWRITE_TEXT_RANGE textRange) PURE;
+STDMETHOD(SetFontSize)(FLOAT fontSize,
+DWRITE_TEXT_RANGE textRange) PURE;
+STDMETHOD(SetUnderline)(WINBOOL hasUnderline,
+DWRITE_TEXT_RANGE textRange) PURE;
+STDMETHOD(SetStrikethrough)(WINBOOL hasStrikethrough,
+DWRITE_TEXT_RANGE textRange) PURE;
+STDMETHOD(SetDrawingEffect)(IUnknown *drawingEffect,
+DWRITE_TEXT_RANGE textRange) PURE;
+STDMETHOD(SetInlineObject)(IDWriteInlineObject *inlineObject,
+DWRITE_TEXT_RANGE textRange) PURE;
+STDMETHOD(SetTypography)(IDWriteTypography *typography,
+DWRITE_TEXT_RANGE textRange) PURE;
+STDMETHOD(SetLocaleName)(WCHAR const *localeName,
+DWRITE_TEXT_RANGE textRange) PURE;
+STDMETHOD_(FLOAT, GetMaxWidth)(void) PURE;
+STDMETHOD_(FLOAT, GetMaxHeight)(void) PURE;
+STDMETHOD(GetFontCollection)(UINT32 currentPosition,
+IDWri

[Mingw-w64-public] [PATCH 2/2] dwrite_1.h: Fix build in C mode

2020-05-08 Thread Ruslan Garipov


Some classes in the file declare overloaded functions, and this causes a
C compiler to fail on module including dwrite_1.h.  This commit fixes
that.

No changes for compilation using C++ mode.

Signed-off-by: ‡Ruslan Garipov 
---
 mingw-w64-headers/include/dwrite_1.h | 651 ---
 1 file changed, 188 insertions(+), 463 deletions(-)


diff --git a/mingw-w64-headers/include/dwrite_1.h b/mingw-w64-headers/include/dwrite_1.h
index 52de1fc75b..00c6b7d103 100644
--- a/mingw-w64-headers/include/dwrite_1.h
+++ b/mingw-w64-headers/include/dwrite_1.h
@@ -9,12 +9,57 @@
 
 #include 
 
-enum DWRITE_OUTLINE_THRESHOLD {
+#ifndef __IDWriteFont1_FWD_DEFINED__
+#define __IDWriteFont1_FWD_DEFINED__
+typedef struct IDWriteFont1 IDWriteFont1;
+#endif
+
+#ifndef __IDWriteFontFace1_FWD_DEFINED__
+#define __IDWriteFontFace1_FWD_DEFINED__
+typedef struct IDWriteFontFace1 IDWriteFontFace1;
+#endif
+
+#ifndef __IDWriteRenderingParams1_FWD_DEFINED__
+#define __IDWriteRenderingParams1_FWD_DEFINED__
+typedef struct IDWriteRenderingParams1 IDWriteRenderingParams1;
+#endif
+
+#ifndef __IDWriteTextAnalysisSource1_FWD_DEFINED__
+#define __IDWriteTextAnalysisSource1_FWD_DEFINED__
+typedef struct IDWriteTextAnalysisSource1 IDWriteTextAnalysisSource1;
+#endif
+
+#ifndef __IDWriteTextAnalysisSink1_FWD_DEFINED__
+#define __IDWriteTextAnalysisSink1_FWD_DEFINED__
+typedef struct IDWriteTextAnalysisSink1 IDWriteTextAnalysisSink1;
+#endif
+
+#ifndef __IDWriteTextAnalyzer1_FWD_DEFINED__
+#define __IDWriteTextAnalyzer1_FWD_DEFINED__
+typedef struct IDWriteTextAnalyzer1 IDWriteTextAnalyzer1;
+#endif
+
+#ifndef __IDWriteTextLayout1_FWD_DEFINED__
+#define __IDWriteTextLayout1_FWD_DEFINED__
+typedef struct IDWriteTextLayout1 IDWriteTextLayout1;
+#endif
+
+#ifndef __IDWriteFactory1_FWD_DEFINED__
+#define __IDWriteFactory1_FWD_DEFINED__
+typedef struct IDWriteFactory1 IDWriteFactory1;
+#endif
+
+#ifndef __IDWriteBitmapRenderTarget1_FWD_DEFINED__
+#define __IDWriteBitmapRenderTarget1_FWD_DEFINED__
+typedef struct IDWriteBitmapRenderTarget1 IDWriteBitmapRenderTarget1;
+#endif
+
+typedef enum DWRITE_OUTLINE_THRESHOLD {
 DWRITE_OUTLINE_THRESHOLD_ANTIALIASED,
 DWRITE_OUTLINE_THRESHOLD_ALIASED
-};
+} DWRITE_OUTLINE_THRESHOLD;
 
-enum DWRITE_BASELINE
+typedef enum DWRITE_BASELINE
 {
 DWRITE_BASELINE_DEFAULT,
 DWRITE_BASELINE_ROMAN,
@@ -25,40 +70,40 @@ enum DWRITE_BASELINE
 DWRITE_BASELINE_IDEOGRAPHIC_TOP,
 DWRITE_BASELINE_MINIMUM,
 DWRITE_BASELINE_MAXIMUM,
-};
+} DWRITE_BASELINE;
 
-enum DWRITE_GLYPH_ORIENTATION_ANGLE
+typedef enum DWRITE_GLYPH_ORIENTATION_ANGLE
 {
 DWRITE_GLYPH_ORIENTATION_ANGLE_0_DEGREES,
 DWRITE_GLYPH_ORIENTATION_ANGLE_90_DEGREES,
 DWRITE_GLYPH_ORIENTATION_ANGLE_180_DEGREES,
 DWRITE_GLYPH_ORIENTATION_ANGLE_270_DEGREES,
-};
+} DWRITE_GLYPH_ORIENTATION_ANGLE;
 
-enum DWRITE_TEXT_ANTIALIAS_MODE
+typedef enum DWRITE_TEXT_ANTIALIAS_MODE
 {
 DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE,
 DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE
-};
+} DWRITE_TEXT_ANTIALIAS_MODE;
 
-enum DWRITE_VERTICAL_GLYPH_ORIENTATION
+typedef enum DWRITE_VERTICAL_GLYPH_ORIENTATION
 {
 DWRITE_VERTICAL_GLYPH_ORIENTATION_DEFAULT,
 DWRITE_VERTICAL_GLYPH_ORIENTATION_STACKED
-};
+} DWRITE_VERTICAL_GLYPH_ORIENTATION;
 
-struct DWRITE_CARET_METRICS {
+typedef struct DWRITE_CARET_METRICS {
 INT16 slopeRise;
 INT16 slopeRun;
 INT16 offset;
-};
+} DWRITE_CARET_METRICS;
 
-struct DWRITE_UNICODE_RANGE {
+typedef struct DWRITE_UNICODE_RANGE {
 UINT32 first;
 UINT32 last;
-};
+} DWRITE_UNICODE_RANGE;
 
-struct DWRITE_FONT_METRICS1
+typedef struct DWRITE_FONT_METRICS1
 #ifdef __cplusplus
 : public DWRITE_FONT_METRICS
 #endif
@@ -88,9 +133,9 @@ struct DWRITE_FONT_METRICS1
 INT16 superscriptSizeX;
 INT16 superscriptSizeY;
 WINBOOL hasTypographicMetrics;
-};
+} DWRITE_FONT_METRICS1;
 
-struct DWRITE_SCRIPT_PROPERTIES
+typedef struct DWRITE_SCRIPT_PROPERTIES
 {
 UINT32 isoScriptCode;
 UINT32 isoScriptNumber;
@@ -104,9 +149,9 @@ struct DWRITE_SCRIPT_PROPERTIES
 UINT32 isConnectedWriting   : 1;
 UINT32 isCursiveWriting : 1;
 UINT32 reserved : 25;
-};
+} DWRITE_SCRIPT_PROPERTIES;
 
-struct DWRITE_JUSTIFICATION_OPPORTUNITY
+typedef struct DWRITE_JUSTIFICATION_OPPORTUNITY
 {
 FLOAT expansionMinimum;
 FLOAT expansionMaximum;
@@ -118,9 +163,9 @@ struct DWRITE_JUSTIFICATION_OPPORTUNITY
 UINT32 applyToLeadingEdge: 1;
 UINT32 applyToTrailingEdge   : 1;
 UINT32 reserved  : 12;
-};
+} DWRITE_JUSTIFICATION_OPPORTUNITY;
 
-union DWRITE_PANOSE {
+typedef union DWRITE_PANOSE {
 UINT8 values[10];
 UINT8 familyKind;
 struct {
@@ -171,7 +216,9 @@ union DWRITE_PANOSE {
 UINT8 aspectRatio163;
 UINT8 aspectRatio211;
 } symbol;
-};
+} DWRITE_PANOSE;
+
+#ifndef D2D_USE_C_DEFINITIONS
 
 #undef  INTERFACE
 #define INTERFACE IDWriteFont1
@@ -179,159 +226,101 @@ DECLARE_INTERFACE_

Re: [Mingw-w64-public] [PATCH 2/3] d2d1_1.h: Add C declaration for ID2D1Factory1

2020-05-07 Thread Ruslan Garipov
On 5/7/2020 5:46 PM, Biswapriyo Nath wrote:
> I was thinking of adding a IDL file so that managing/editing the interface
> declaration would be simple.
Don't do that if d2d1_1.h will end up with overloaded member functions
in a parent and child structs for C code, as dwrite.h and
IDWriteTextLayout did.

I'll send my patch for dwrite.h later.

> 
> ___
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
> 


___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH 3/3] .gitignore: Add Vim swap files

2020-05-07 Thread Ruslan Garipov


Signed-off-by: ‡Ruslan Garipov 
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)


diff --git a/.gitignore b/.gitignore
index d89921897a..f13c3ba471 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 autom4te.cache
+*.sw?

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH 2/3] d2d1_1.h: Add C declaration for ID2D1Factory1

2020-05-07 Thread Ruslan Garipov

On 5/7/2020 4:04 PM, Ruslan Garipov wrote:


Signed-off-by: ‡Ruslan Garipov 
---
  mingw-w64-headers/include/d2d1_1.h | 52 +-
  1 file changed, 51 insertions(+), 1 deletion(-)



There are still plenty of other declarations of incomplete types in
d2d1_1.h.  I just started from the ID2D1Factory1 interface.


___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH 2/3] d2d1_1.h: Add C declaration for ID2D1Factory1

2020-05-07 Thread Ruslan Garipov


Signed-off-by: ‡Ruslan Garipov 
---
 mingw-w64-headers/include/d2d1_1.h | 52 +-
 1 file changed, 51 insertions(+), 1 deletion(-)


diff --git a/mingw-w64-headers/include/d2d1_1.h b/mingw-w64-headers/include/d2d1_1.h
index de2cb091b6..5c97245dcf 100644
--- a/mingw-w64-headers/include/d2d1_1.h
+++ b/mingw-w64-headers/include/d2d1_1.h
@@ -999,7 +999,57 @@ interface ID2D1Factory1 : public ID2D1Factory
 #else
 
 typedef interface ID2D1Factory1 ID2D1Factory1;
-/* FIXME: Add full C declaration */
+
+typedef struct ID2D1Factory1Vtbl {
+ID2D1FactoryVtbl Base;
+
+STDMETHOD(CreateDevice)(ID2D1Factory1 *This, IDXGIDevice *dxgiDevice,
+ID2D1Device **d2dDevice) PURE;
+STDMETHOD(CreateStrokeStyle)(ID2D1Factory1 *This,
+CONST D2D1_STROKE_STYLE_PROPERTIES1 *strokeStyleProperties,
+CONST FLOAT *dashes, UINT32 dashesCount,
+ID2D1StrokeStyle1 **strokeStyle) PURE;
+STDMETHOD(CreatePathGeometry)(ID2D1Factory1 *This,
+ID2D1PathGeometry1 **pathGeometry) PURE;
+STDMETHOD(CreateDrawingStateBlock)(ID2D1Factory1 *This,
+CONST D2D1_DRAWING_STATE_DESCRIPTION1 *drawingStateDescription,
+IDWriteRenderingParams *textRenderingParams,
+ID2D1DrawingStateBlock1 **drawingStateBlock) PURE;
+STDMETHOD(CreateGdiMetafile)(ID2D1Factory1 *This, IStream *metafileStream,
+ID2D1GdiMetafile **metafile) PURE;
+STDMETHOD(RegisterEffectFromStream)(ID2D1Factory1 *This, REFCLSID classId,
+IStream *propertyXml, CONST D2D1_PROPERTY_BINDING *bindings,
+UINT32 bindingsCount,
+CONST PD2D1_EFFECT_FACTORY effectFactory) PURE;
+STDMETHOD(RegisterEffectFromString)(ID2D1Factory1 *This,
+REFCLSID classId, PCWSTR propertyXml,
+CONST D2D1_PROPERTY_BINDING *bindings, UINT32 bindingsCount,
+CONST PD2D1_EFFECT_FACTORY effectFactory) PURE;
+STDMETHOD(UnregisterEffect)(ID2D1Factory1 *This, REFCLSID classId) PURE;
+STDMETHOD(GetRegisteredEffects)(ID2D1Factory1 *This, CLSID *effects,
+UINT32 effectsCount, UINT32 *effectsReturned,
+UINT32 *effectsRegistered) PURE;
+STDMETHOD(GetEffectProperties)(ID2D1Factory1 *This, REFCLSID effectId,
+ID2D1Properties **properties) PURE;
+} ID2D1Factory1Vtbl;
+
+interface ID2D1Factory1 {
+const ID2D1Factory1Vtbl *lpVtbl;
+};
+
+#define ID2D1Factory1_QueryInterface(this,A,B) (this)->lpVtbl->Base.Base.QueryInterface((IUnknown *)(this),A,B)
+#define ID2D1Factory1_AddRef(this) (this)->lpVtbl->Base.Base.AddRef((IUnknown *)(this))
+#define ID2D1Factory1_Release(this) (this)->lpVtbl->Base.Base.Release((IUnknown *)(this))
+#define ID2D1Factory1_CreateDevice(this,A,B) (this)->lpVtbl->CreateDevice(this,A,B)
+#define ID2D1Factory1_CreateStrokeStyle(this,A,B,C,D) (this)->lpVtbl->CreateStrokeStyle(this,A,B,C,D)
+#define ID2D1Factory1_CreatePathGeometry(this,A) (this)->lpVbtl->CreatePathGeometry(this,A)
+#define ID2D1Factory1_CreateDrawingStateBlock(this,A,B, C) (this)->lpVtbl->CreateDrawingStateBlock(this,A,B,C)
+#define ID2D1Factory1_CreateGdiMetafile(this,A,B) (this)->lpVtbl->CreateGdiMetafile(this,A,B)
+#define ID2D1Factory1_RegisterEffectFromStream(this,A,B,C,D,E) (this)->lpVtbl->RegisterEffectFromStream(this,A,B,C,D,E)
+#define ID2D1Factory1_RegisterEffectFromString(this,A,B,C,D,E) (this)->lpVtbl->RegisterEffectFromString(this,A,B,C,D,E)
+#define ID2D1Factory1_UnregisterEffect(this,A) (this)->lpVtbl->UnregisterEffect(this,A)
+#define ID2D1Factory1_GetRegisteredEffects(this,A,B,C,D) (this)->lpVtbl->GetRegisteredEffects(this,A,B,C,D)
+#define ID2D1Factory1_GetEffectProperties(this,A,B) (this)->lpVtbl->GetEffectProperties(this,A,B)
 
 #endif
 

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH 1/3] dwrite.h: Add missed parenthesis

2020-05-07 Thread Ruslan Garipov

This commit partially fixes compilation of a C code module which
#include's dwrite.h.  One still can't compile such modules successfully
because some classes in dwrite.h declare overloaded member functions.

No functional changes intended.

Signed-off-by: ‡Ruslan Garipov 
---
 mingw-w64-headers/include/dwrite.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/mingw-w64-headers/include/dwrite.h b/mingw-w64-headers/include/dwrite.h
index 9a0cc02dd6..943cd738ca 100644
--- a/mingw-w64-headers/include/dwrite.h
+++ b/mingw-w64-headers/include/dwrite.h
@@ -1430,7 +1430,7 @@ DECLARE_INTERFACE_(IDWriteLocalFontFileLoader,IDWriteFontFileLoader)
 STDMETHOD_(ULONG, Release)(THIS) PURE;
 
 /* IDWriteFontFileLoader methods */
-STDMETHOD(CreateStreamFromKey(THIS_ const void *fontFileReferenceKey,UINT32 fontFileReferenceKeySize,IDWriteFontFileStream **fileStream) PURE;
+STDMETHOD(CreateStreamFromKey)(THIS_ const void *fontFileReferenceKey,UINT32 fontFileReferenceKeySize,IDWriteFontFileStream **fileStream) PURE;
 #endif
 
 /* IDWriteLocalFontFileLoader methods */

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] How to compile a module including dwrite.h with C compiler?

2020-05-04 Thread Ruslan Garipov

Hello!

The IDWriteTextLayout[1] interface inherits from the
IDWriteTextFormat[2] one.  Both declare, for example,
GetFontCollection() members.  Therefore, IDWriteTextLayout exploits C++
function overloading, which isn't available in C.

And that's where I failed: I need to compile a C code module including
dwrite.h header using CC:

$ cc -x c dwrite.h -o /dev/null 2>&1 | fgrep GetFontCollection
dwrite.h:2006:15: error: duplicate member 'GetFontCollection'
 2006 | STDMETHOD(GetFontCollection)(THIS_

Of course, there are other "duplicated member functions" like
GetFontFamilyNameLength(), GetFontFamilyName(), etc.

How can I compile my C code?  Am I doomed to use ITypeInfo and IDispatch
for IDWriteTextLayout objects in C code?

Oh, by the way, revision 75bdd3 misses a parenthesis:

diff --git a/mingw-w64-headers/include/dwrite.h 
b/mingw-w64-headers/include/dwrite.h

index 9a0cc02d..943cd738 100644
--- a/mingw-w64-headers/include/dwrite.h
+++ b/mingw-w64-headers/include/dwrite.h
@@ -1430,7 +1430,7 @@ 
DECLARE_INTERFACE_(IDWriteLocalFontFileLoader,IDWriteFontFileLoader)

 STDMETHOD_(ULONG, Release)(THIS) PURE;

 /* IDWriteFontFileLoader methods */
-STDMETHOD(CreateStreamFromKey(THIS_ const void 
*fontFileReferenceKey,UINT32 
fontFileReferenceKeySize,IDWriteFontFileStream **fileStream) PURE;
+STDMETHOD(CreateStreamFromKey)(THIS_ const void 
*fontFileReferenceKey,UINT32 
fontFileReferenceKeySize,IDWriteFontFileStream **fileStream) PURE;

 #endif

 /* IDWriteLocalFontFileLoader methods */

[1] 
https://docs.microsoft.com/en-us/windows/win32/api/dwrite/nn-dwrite-idwritetextlayout
[2] 
https://docs.microsoft.com/en-us/windows/win32/api/dwrite/nn-dwrite-idwritetextformat



___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] Add Microsoft OLE DB driver for SQL server

2019-03-09 Thread Ruslan Garipov
> please do not include the diff of generated files

Before I had changed 'mingw-w64-crt/Makefile.in' I thought
'mingw-w64-crt/configure' + automake regenerate the .in file from
the updated .am ones.  But I was wrong (well, I ain't an automake
expert, because I didn't use it in my everyday workflow, sorry), and I
failed to build new mingw-w64's CRT having libmsoledbsql.a.  Therefore,
I updated 'mingw-w64-crt/Makefile.in', which is under git control.

> 'Makefile.in' is generated from 'Makefile.am' using `autoreconf -if'

Do I understand correctly that 'mingw-w64-crt/Makefile.in' must be
checked in via dedicated commits like 4ed230ca?

```
$ git log --oneline mingw-w64-crt/Makefile.in | grep [Rr]egenerate
4ed230ca crt: Regenerate configure.
8fcb463f crt: Regenerate Makefile.in.
d72c4fe6 crt: Regenerate configure.
9077bf73 crt: Regenerate Makefile.in
161a6439 crt: Regenerate Makefile.in
b84ab0fc crt: Regenerate Makefile.in
...
```

> There shall be no semicolons following
> `MSOLEDBSQL_H_DECL_SSVARIANT_STRUCTS`

Oh, sorry for that -- it's my habit to put semicolon even after macro.
I've known it results in double semicolons after preprocessor, and some
compilers may warn about that... I'm sorry, and thanks for fix that.

> Thank you very much for the work and the discussion. The patch looks
> good now.  I amended the patch and pushed it.

I thank you too for your review, fixes and conversation!  It was nice
experience for me!

On 3/9/2019 7:42 AM, Liu Hao wrote:
> 在 2019/3/7 13:08, Ruslan Garipov 写道:
>> Signed-off-by: Ruslan Garipov 
>> ---
>> mingw-w64-crt/Makefile.in  |    4 +-
> 
> Next time, please do not include the diff of generated files.
> 'Makefile.in' is generated from 'Makefile.am' using `autoreconf -if' so
> only the diff of 'Makefile.am' need appear in the patch.  I removed this
> from the patch.
> 
> For this patch there is no modification to 'Makefile.am', however.
> 
>> mingw-w64-crt/lib32/Makefile.am    |    1 +
>> mingw-w64-crt/lib32/msoledbsql.def |   13 +
>> mingw-w64-crt/lib64/Makefile.am    |    1 +
>> mingw-w64-crt/lib64/msoledbsql.def |   13 +
>> mingw-w64-headers/include/msoledbsql.h | 1452 
>> 6 files changed, 1482 insertions(+), 2 deletions(-)
>> create mode 100644 mingw-w64-crt/lib32/msoledbsql.def
>> create mode 100644 mingw-w64-crt/lib64/msoledbsql.def
>> create mode 100644 mingw-w64-headers/include/msoledbsql.h
>>
> 
>> +#ifndef __cplusplus
>> +  MSOLEDBSQL_H_DECL_SSVARIANT_STRUCTS;
>> +#endif
>> +struct SSVARIANT {
>> +  SSVARTYPE vt;
>> +  DWORD dwReserved1;
>> +  DWORD dwReserved2;
>> +  /* For C++ code (`-x c++`/`-Tp`) we may move the declarations here.  
>> This, at
>> +   * least, limits scope of the declarations to the `SSVARIANT` structure, 
>> if we
>> +   * compare declaration of the structures at the global scope (as it's 
>> made for
>> +   * C code).  Both variants break public API of the original header file, 
>> but
>> +   * unfortunately that's unavoidable. */
>> +#ifdef __cplusplus
>> +  MSOLEDBSQL_H_DECL_SSVARIANT_STRUCTS;
>> +#endif
> 
> There shall be no semicolons following
> `MSOLEDBSQL_H_DECL_SSVARIANT_STRUCTS`. I removed them, too.
> 
> Thank you very much for the work and the discussion. The patch looks
> good now.  I amended the patch and pushed it.


___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] Add Microsoft OLE DB driver for SQL server

2019-03-06 Thread Ruslan Garipov

In August of 2011[1] Microsoft announced deprecation of the Microsoft
OLE DB Provider for SQL Server.  But in October of 2017 Microsoft had to
undeprecate[2] OLE DB data access technology releasing the ``Microsoft
OLE DB Driver for SQL Server'' known as ``msoledbsql''.

This commit adds the ``msoledbsql'' API to mingw-w64 -- the only OLE DB
data access solution supported and maintained by Microsoft now.

To provide class and interface identifiers msoledbsql.h in this commit
uses the same technique as, for example, mingw-w64's sqloledb.h file,
i.e. it uses the `DBINITCONSTANTS` guard to define identifiers only in
one module.  Original Microsoft's files (both msoledbsql.h from the new
API and sqloledb.h from Microsoft Windows 10 SDK) use
`__declspec(selectany)` to move that "burden" to the linker.

The original Microsoft's msoledbsql.h uses a Microsoft-specific
"extension", which allows Microsoft Visual C++ compiler to ignore the
following paragraph of the Standard for programming language C++:


10.4.1 Anonymous unions [class.union.anon]
1 ... Each member-declaration in the member-specification of an
anonymous union shall either define a non-static data member or be a
static_assert-declaration. [Note: Nested types, anonymous unions, and
functions cannot be declared within an anonymous union.  —end note]


and successfully compile a code like this:

```
struct SSVARIANT
{
 union
 {
   struct _Time2Val
   {
   } Time2Val;
 };
};
```

GNU C++ and clang++ aren't compatible with such behavior.  Moreover,
those compilers don't allow `typedef`s within anonymous unions (again
because of the [class.union.anon]).  Therefore, I have to break public
API of the original header file related to the `SSVARIANT` structure
type.

Review log: https://sf.net/p/mingw-w64/mailman/mingw-w64-public/thread/
9754bd81-b475-728f-79ce-10e626757a17%40gmail.com/.

[1]: https://blogs.msdn.microsoft.com/sqlnativeclient/2011/08/29/
microsoft-is-aligning-with-odbc-for-native-relational-data-access/
[2]: https://blogs.msdn.microsoft.com/sqlnativeclient/2017/10/06/
announcing-the-new-release-of-ole-db-driver-for-sql-server/

Signed-off-by: Ruslan Garipov 
---
mingw-w64-crt/Makefile.in  |4 +-
mingw-w64-crt/lib32/Makefile.am|1 +
mingw-w64-crt/lib32/msoledbsql.def |   13 +
mingw-w64-crt/lib64/Makefile.am|1 +
mingw-w64-crt/lib64/msoledbsql.def |   13 +
mingw-w64-headers/include/msoledbsql.h | 1452 
6 files changed, 1482 insertions(+), 2 deletions(-)
create mode 100644 mingw-w64-crt/lib32/msoledbsql.def
create mode 100644 mingw-w64-crt/lib64/msoledbsql.def
create mode 100644 mingw-w64-headers/include/msoledbsql.h

diff --git a/mingw-w64-crt/Makefile.in b/mingw-w64-crt/Makefile.in
index 19c2c6f8..28399817 100644
--- a/mingw-w64-crt/Makefile.in
+++ b/mingw-w64-crt/Makefile.in
@@ -7361,7 +7361,7 @@ src_intrincsarm64 =
 @LIB32_TRUE@   lib32/libmsctf.a lib32/libmsctfmonitor.a \
 @LIB32_TRUE@   lib32/libmsdmo.a lib32/libmsdrm.a \
 @LIB32_TRUE@   lib32/libmshtml.a lib32/libmshtmled.a \
-@LIB32_TRUE@   lib32/libmsi.a lib32/libmsimg32.a \
+@LIB32_TRUE@   lib32/libmsi.a lib32/libmsimg32.a lib32/libmsoledbsql.a \
 @LIB32_TRUE@   lib32/libmstask.a lib32/libmsvfw32.a \
 @LIB32_TRUE@   lib32/libmswsock.a lib32/libncrypt.a \
 @LIB32_TRUE@   lib32/libnddeapi.a lib32/libndfapi.a \
@@ -7786,7 +7786,7 @@ src_intrincsarm64 =
 @LIB64_TRUE@   lib64/libmslbui.a lib64/libmsls31.a \
 @LIB64_TRUE@   lib64/libmsmqocm.a lib64/libmsobdl.a \
 @LIB64_TRUE@   lib64/libmsobmain.a lib64/libmsoeacct.a \
-@LIB64_TRUE@   lib64/libmsoe.a lib64/libmsoert2.a \
+@LIB64_TRUE@   lib64/libmsoe.a lib64/libmsoert2.a lib64/libmsoledbsql.a \
 @LIB64_TRUE@   lib64/libmspatcha.a lib64/libmsports.a \
 @LIB64_TRUE@   lib64/libmsrating.a lib64/libmsrle32.a \
 @LIB64_TRUE@   lib64/libmssign32.a lib64/libmssip32.a \
diff --git a/mingw-w64-crt/lib32/Makefile.am b/mingw-w64-crt/lib32/Makefile.am
index 065098f5..cb63da4f 100644
--- a/mingw-w64-crt/lib32/Makefile.am
+++ b/mingw-w64-crt/lib32/Makefile.am
@@ -178,6 +178,7 @@ lib32_DATA += %reldir%/libmshtml.a
 lib32_DATA += %reldir%/libmshtmled.a
 lib32_DATA += %reldir%/libmsi.a
 lib32_DATA += %reldir%/libmsimg32.a
+lib32_DATA += %reldir%/libmsoledbsql.a
 lib32_DATA += %reldir%/libmstask.a
 #lib32_DATA += %reldir%/libmsvcp60.a # Specialized for W32API conditional
 lib32_DATA += %reldir%/libmsvfw32.a
diff --git a/mingw-w64-crt/lib32/msoledbsql.def 
b/mingw-w64-crt/lib32/msoledbsql.def
new file mode 100644
index ..fbea8771
--- /dev/null
+++ b/mingw-w64-crt/lib32/msoledbsql.def
@@ -0,0 +1,13 @@
+;
+; Definition file of msoledbsql.dll
+; Automatic generated by gendef
+; written by Kai Tietz 2008
+;
+LIBRARY "msoledbsql.dll"
+EXPORTS
+DllCanUnloadNow@0
+DllGetClassObject@12
+DllMain@12
+DllRegisterServer@0
+DllUnregisterServer@0
+OpenSqlFilestream@24
diff --git a/mingw-w64-crt/lib64/Makefile.am b/mingw-w64-crt/lib64/Makefile.am
index 0a9c856b..772fb

[Mingw-w64-public] [PATCH] Add Microsoft OLE DB driver for SQL server

2019-03-06 Thread Ruslan Garipov

In August of 2011[1] Microsoft announced deprecation of the Microsoft
OLE DB Provider for SQL Server.  But in October of 2017 Microsoft had to
undeprecate[2] OLE DB data access technology releasing the ``Microsoft
OLE DB Driver for SQL Server'' known as ``msoledbsql''.

This commit adds the ``msoledbsql'' API to mingw-w64 -- the only OLE DB
data access solution supported and maintained by Microsoft now.

To provide class and interface identifiers msoledbsql.h in this commit
uses the same technique as, for example, mingw-w64's sqloledb.h file,
i.e. it uses the `DBINITCONSTANTS` guard to define identifiers only in
one module.  Original Microsoft's files (both msoledbsql.h from the new
API and sqloledb.h from Microsoft Windows 10 SDK) use
`__declspec(selectany)` to move that "burden" to the linker.

The original Microsoft's msoledbsql.h uses a Microsoft-specific
"extension", which allows Microsoft Visual C++ compiler to ignore the
following paragraph of the Standard for programming language C++:


10.4.1 Anonymous unions [class.union.anon]
1 ... Each member-declaration in the member-specification of an
anonymous union shall either define a non-static data member or be a
static_assert-declaration. [Note: Nested types, anonymous unions, and
functions cannot be declared within an anonymous union.  —end note]


and successfully compile a code like this:

```
struct SSVARIANT
{
 union
 {
   struct _Time2Val
   {
   } Time2Val;
 };
};
```

GNU C++ and clang++ aren't compatible with such behavior.  Moreover,
those compilers don't allow `typedef`s within anonymous unions (again
because of the [class.union.anon]).  Therefore, I have to break public
API of the original header file related to the `SSVARIANT` structure
type.

Review log: https://sf.net/p/mingw-w64/mailman/mingw-w64-public/thread/
9754bd81-b475-728f-79ce-10e626757a17%40gmail.com/.

[1]: https://blogs.msdn.microsoft.com/sqlnativeclient/2011/08/29/
microsoft-is-aligning-with-odbc-for-native-relational-data-access/
[2]: https://blogs.msdn.microsoft.com/sqlnativeclient/2017/10/06/
announcing-the-new-release-of-ole-db-driver-for-sql-server/

Signed-off-by: Ruslan Garipov 
---
mingw-w64-crt/Makefile.in  |4 +-
mingw-w64-crt/lib32/Makefile.am|1 +
mingw-w64-crt/lib32/msoledbsql.def |   13 +
mingw-w64-crt/lib64/Makefile.am|1 +
mingw-w64-crt/lib64/msoledbsql.def |   13 +
mingw-w64-headers/include/msoledbsql.h | 1454 
6 files changed, 1484 insertions(+), 2 deletions(-)
create mode 100644 mingw-w64-crt/lib32/msoledbsql.def
create mode 100644 mingw-w64-crt/lib64/msoledbsql.def
create mode 100644 mingw-w64-headers/include/msoledbsql.h

diff --git a/mingw-w64-crt/Makefile.in b/mingw-w64-crt/Makefile.in
index 19c2c6f8..28399817 100644
--- a/mingw-w64-crt/Makefile.in
+++ b/mingw-w64-crt/Makefile.in
@@ -7361,7 +7361,7 @@ src_intrincsarm64 =
 @LIB32_TRUE@   lib32/libmsctf.a lib32/libmsctfmonitor.a \
 @LIB32_TRUE@   lib32/libmsdmo.a lib32/libmsdrm.a \
 @LIB32_TRUE@   lib32/libmshtml.a lib32/libmshtmled.a \
-@LIB32_TRUE@   lib32/libmsi.a lib32/libmsimg32.a \
+@LIB32_TRUE@   lib32/libmsi.a lib32/libmsimg32.a lib32/libmsoledbsql.a \
 @LIB32_TRUE@   lib32/libmstask.a lib32/libmsvfw32.a \
 @LIB32_TRUE@   lib32/libmswsock.a lib32/libncrypt.a \
 @LIB32_TRUE@   lib32/libnddeapi.a lib32/libndfapi.a \
@@ -7786,7 +7786,7 @@ src_intrincsarm64 =
 @LIB64_TRUE@   lib64/libmslbui.a lib64/libmsls31.a \
 @LIB64_TRUE@   lib64/libmsmqocm.a lib64/libmsobdl.a \
 @LIB64_TRUE@   lib64/libmsobmain.a lib64/libmsoeacct.a \
-@LIB64_TRUE@   lib64/libmsoe.a lib64/libmsoert2.a \
+@LIB64_TRUE@   lib64/libmsoe.a lib64/libmsoert2.a lib64/libmsoledbsql.a \
 @LIB64_TRUE@   lib64/libmspatcha.a lib64/libmsports.a \
 @LIB64_TRUE@   lib64/libmsrating.a lib64/libmsrle32.a \
 @LIB64_TRUE@   lib64/libmssign32.a lib64/libmssip32.a \
diff --git a/mingw-w64-crt/lib32/Makefile.am b/mingw-w64-crt/lib32/Makefile.am
index 065098f5..cb63da4f 100644
--- a/mingw-w64-crt/lib32/Makefile.am
+++ b/mingw-w64-crt/lib32/Makefile.am
@@ -178,6 +178,7 @@ lib32_DATA += %reldir%/libmshtml.a
 lib32_DATA += %reldir%/libmshtmled.a
 lib32_DATA += %reldir%/libmsi.a
 lib32_DATA += %reldir%/libmsimg32.a
+lib32_DATA += %reldir%/libmsoledbsql.a
 lib32_DATA += %reldir%/libmstask.a
 #lib32_DATA += %reldir%/libmsvcp60.a # Specialized for W32API conditional
 lib32_DATA += %reldir%/libmsvfw32.a
diff --git a/mingw-w64-crt/lib32/msoledbsql.def 
b/mingw-w64-crt/lib32/msoledbsql.def
new file mode 100644
index ..fbea8771
--- /dev/null
+++ b/mingw-w64-crt/lib32/msoledbsql.def
@@ -0,0 +1,13 @@
+;
+; Definition file of msoledbsql.dll
+; Automatic generated by gendef
+; written by Kai Tietz 2008
+;
+LIBRARY "msoledbsql.dll"
+EXPORTS
+DllCanUnloadNow@0
+DllGetClassObject@12
+DllMain@12
+DllRegisterServer@0
+DllUnregisterServer@0
+OpenSqlFilestream@24
diff --git a/mingw-w64-crt/lib64/Makefile.am b/mingw-w64-crt/lib64/Makefile.am
index 0a9c856b..772fb

Re: [Mingw-w64-public] [PATCH] Add Microsoft OLE DB driver for SQL server

2019-03-04 Thread Ruslan Garipov
> See the following code:
> (... trimmed ...)

Hao, thanks for explanations.  Now I understand everything.

But please allow me to make some notes.

> struct foo
>   {
> struct bar
>   {
> char one;
>   };
> char two;
>   };
> ...
> // This prints 2 when compiled as C, because the member `one` of
> // `struct bar` is a member of the enclosing struct i.e. `foo`.
> // This prints 1 when compiled as C++.
> printf("%d\n", (int)sizeof(struct foo));

With C compilers that prints ``2'' **sometimes** :-)  Because of
`-fms-extensions`[1].

When it's on (and for mingw it's on by default), compiling your sample
with the following command:

```
$ x86_64-w64-mingw32-gcc -x c -std=c17 -O2 -S -fms-extensions \
-o - sample.c
```

results in:

```
movl$2, %edx  ; `sizeof(struct foo)`
callprintf
```

And with `-fms-extensions` turned off:

```
$ x86_64-w64-mingw32-gcc -x c -std=c17 -O2 -S -fno-ms-extensions \
-o - sample17.c
...
movl$1, %edx
callprintf
```

This is why I've got inconsistent results with different C
compilers[2][3].  Therefore, the following code (the second version of
the patch):

```
struct SSVARIANT {
  /* declaration of some fields */
  struct _Time2Val {
DBTIME2 tTime2Val;
BYTE bScale;
  };
  ...
};
```

isn't always valid for a C compiler because of:

a) some C compilers know about `-fms-extensions`, and if the latter is
used, the `_Time2Val` becomes[1] anonymous structure, and, as a
consequence, the members of the `_Time2Val` are considered to be members
of the `SSVARIANT`[4].  This, I believe, changes layout of structure in
memory, when compare it with "original" structure (from my initial
patch).  Moreover, when several structures like the `_Time2Val` and
`_DateTimeVal` have members of the same name (the `bScale` in this
case), we end up with a compilation error[3].

b) for all other C compilers there's no much sense to declare structures
like the `_Time2Val` within the `SSVARIANT`.  Semantically it declares
all those structures at scope where the header is included (6.2.1 Scopes
of identifiers).  The original version of the patch provides some
"logical locality" of declarations of the tags like `_Time2Val`,
combining a structure declaration with field definition, but it doesn't
change semantics: the tags are available after the completion of their
corresponding declarators at scope where the header is included.

Therefore, as we've already discussed, for a C compiler we may declare
the `_Time2Val` structure and others just before the `SSVARIANT`
structure.  But for a C++ compiler we should avoid that, I believe,
because original API of msoledbsql.h file doesn't have such a type like
`::_Time2Val`.  We should preserve the
`SSVARIANT::{unnamed union}::_Time2Val` type, but there's another broken
"feature" of Microsoft Visual C++.

Errors which Liu Hao found[5] when compiling the code with g++, are the
result of:

> 10.4.1 Anonymous unions [class.union.anon]
> 1 ... Each member-declaration in the member-specification of an
> anonymous union shall either define a non-static data member or be a
> static_assert-declaration. [Note: Nested types, anonymous unions, and
> functions cannot be declared within an anonymous union. -end note]

But MSVC ignores that and compiles the following code successfully:

```
struct SSVARIANT
{
  union
  {
struct _Time2Val
{
} Time2Val;
  };
};
```

GNU C++ is not compatible with such behavior.  Moreover, GNU C++ doesn't
allow `typedef`s within anonymous unions (again because of
[class.union.anon]).  Therefore, we can't declare a type like
`SSVARIANT::{unnamed union}::_Time2Val` with GNU C++.  We may declare[5]
all such types directly inside `SSVARIANT` (for C++ **only** -- see
above), creating the types like `SSVARIANT::_Time2Val`, but we change
original API of msoledbsql.h again -- there are no such types there.
Thus, I believe, it's impossible to reproduce that (original) code,
which is specific to Microsoft "extensions", in a form compatible with
the C++ standard.

We may move all those types (`_Time2Val` and others) out from the
`SSVARIANT` completely (just as we already did that for C, we may do
that for C++), and end up with `::_Time2Val`, `::_DateTimeVal`, etc. for
a C++ compiler.  Yes, it also modifies the original API, but unify the
code which declares the `SSVARIANT` between C and C++.  Though I believe
that having the types scoped to the `SSVARIANT` (`SSVARIANT::_Time2Val`,
`SSVARIANT::_DateTimeVal`, etc.) is the lesser of two evils.  And for
the latter I have only not-very-beautiful solution with a preprocessor
macro.

> The typedef there is to make the qualified name `SSVARIANT::_Time2Val`
> valid in C++, as in the old, non-working code.

I see, thanks once again for explanation!

[1]: https://gcc.gnu.org/onlinedocs/gcc/Unnamed-Fields.html
"6.63 Unnamed Structure and Union Fields"
[2]: https://sourceforge.net/p/mingw-w64/mailman/message/36600915/
[3]: 

Re: [Mingw-w64-public] [PATCH] Add Microsoft OLE DB driver for SQL server

2019-03-02 Thread Ruslan Garipov
>> Nifty :-)  Actually I've believed that **declaration** of nested
>> structures is just a declaration, and no code/data will be generated
>> for that.  But it turns out that I was wrong.
>
> This is an important difference between C and C++.

I'm sorry, but I'm confused a little bit: what is ``this'' that "is an
important difference between C and C++"?  I've talked (the quote of me
above) about C compilers only, and I was wondering how you could
predicate that members of the nested structures (**from their
declarations**) become **real** members of the enclosing structure. :-)
Would you please explain me your thoughts?

But what has confused me more is your sample.  A joke :-)  The following
discussion in this message assumes that we are talking about C++
compilers only.

```
#ifdef __cplusplus
typedef struct _Time2Val _Time2Val
#endif
```

Okay, I understand that here you declares new ``typedef-name'' (the
"second" `_Time2Val`) for naming ``elaborated-type-specifier''
(`struct _Time2Val`).  What I do **not** understand is why you've
introduced that ``typedef-name''?  What is its purpose?  To use it in
the next field declaration?  But why not just use
``elaborated-type-specifier'' "directly" there?

The next statement is:

```
struct _Time2Val Time2Val;
```

I'm sorry, but it's "ill-formed"

> 9.1.7.3 Elaborated type specifiers [dcl.type.elab]
> 2 ... If the identifier resolves to a typedef-name ..., the
> elaborated-type-specifier is ill-formed.
> ...
> 3 ... Thus, in any elaborated-type-specifier, ... either the class or
> struct class-key shall be used to refer to a class (Clause 10)
> declared using the class or struct class-key.

Here is your sample on Matt Godbolt's ``Compiler explorer'':
https://godbolt.org/z/1RVfhQ (I simplified the sample, renamed
identifiers (`_Time2Val` -> `A`; `SSVARIANT` -> `B`; `Time2Val` ->
`a`) and removed the anonymous `union` -- it doesn't play a role there).
GCC (and some others (clang, icc, but not msvc)) failed to compile the
sample with this error (after "translating" names back): "using
typedef-name 'SSVARIANT::{unnamed union}::_Time2Val' after 'struct'" --
this what [dcl.type.elab] (2) is talking about.

But it doesn't matter, though.  What I really want to understand is what
did you want to do, Hao.  Please, explain, it's very important to me.

And what I've planned to post on the next Tuesday is something like
this:

```
define MSOLEDBSQL_H_DECL_VAR_TYPES do { \
struct _Time2Val { \
  DBTIME2 tTime2Val; \
  BYTE bScale; \
}; \
struct _DateTimeVal { \
... and so on: declare all "nested" structs here ..
}; \
} while (0)
#ifndef __cplusplus
MSOLEDBSQL_H_DECL_VAR_TYPES;
#endif
struct SSVARIANT {
  /* declaration of some fields */
#ifdef __cplusplus
  MSOLEDBSQL_H_DECL_VAR_TYPES;
#endif
  union {
/* declaration of some other fields */
_Time2Val Time2Val;
_DateTimeVal DateTimeVal;
...
  };
};
```

May be this is not a sophisticated solution, but it's a simple one (for
me) and it avoids double declaration problem.

On 3/2/2019 7:38 AM, Liu Hao wrote:
> 在 2019/3/2 上午2:13, Ruslan Garipov 写道:
>>> This can be verified by printing the size of the enclosing struct
>>> using GCC with our header, then comparing it with the result using
>>> MSVC and Microsoft header.
>>
>> Nifty :-)  Actually I've believed that **declaration** of nested
>> structures is just a declaration, and no code/data will be generated for
>> that.  But it turns out that I was wrong.
>>
> 
> This is an important difference between C and C++.
> 
> Well I think we may try this:
> 
> ```
> struct _Time2Val
>   {
> // some fields...
>   };
> 
> struct SSVARIANT
>   {
> // some fields...
> union  // anonymous union
>   {
> #ifdef __cplusplus
> // The elaborated-type-specifier will reference the struct
> // in the global namespace and its use is mandatory here.
> typedef struct _Time2Val _Time2Val
> #endif
> struct _Time2Val Time2Val;
>   };
>   };
> ```
> 
> 


___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] Add Microsoft OLE DB driver for SQL server

2019-03-01 Thread Ruslan Garipov
> This can be verified by printing the size of the enclosing struct
> using GCC with our header, then comparing it with the result using
> MSVC and Microsoft header.

Nifty :-)  Actually I've believed that **declaration** of nested
structures is just a declaration, and no code/data will be generated for
that.  But it turns out that I was wrong.

Thus, if I have the following sample.c file:

```
struct A
{
  struct B {int b;};
  struct C {int c;};
};

int
main(void)
{
  return sizeof (struct A);
}
```

and compile it with GCC v8.2.1 on a Linux-based OS I get:

```
$ x86_64-pc-linux-gnu-gcc gcc -O2 -S -o - sample.c
...
xorl%eax, %eax
ret
```

Well, that's fine -- I get an empty `struct A`, just as it was declared.

But if I compile the file with x86_64-w64-mingw32-gcc on Microsoft
Windows:

```
$ x86_64-w64-mingw32-gcc -O2 -S -o - sample.c
...
movl$8, %eax
...
ret
```

Oops...  I get a non-empty (!) `struct A` with two 4-bytes `int` fields!
That's a bug I believe. :-(

> It would result in duplicated definitions which I think is pretty bad

Okay, I will publish new patch for reviewing on the next Tuesday,
3/5/2019, after 3:00 AM UTC.  Unfortunately, I can't publish it earlier.

Thanks!

On 3/1/2019 7:33 PM, Liu Hao wrote:
> 在 2019/3/1 15:14, Ruslan Garipov 写道:
>>> It looks like we have ended up in a bug there
>>
>> I don't know :-(  To summarize: MSVC, Intel C++ and GCC on Microsoft
>> Windows fail to compile that sample C code.  But clang for Microsoft
>> Windows does compile the code (just like GCC for Linux-based OSes). 
>> clang-cl fails to compile of course; due to the back-end shared with
>> MSVC I believe.
>>
> 
> This can be verified by printing the size of the enclosing struct using
> GCC with our header, then comparing it with the result using MSVC and
> Microsoft header.
> 
>>> I think we should try promoting named nested structs and unions (so
>>> they appear in the file scope). At least this works for both C and
>>> C++, providing these names don't conflict with each other.
>>
>> If I understand you correctly, you propose to move declarations of the
>> nested structures like `_Time2Val`, `_DateTimeVal` and so on out of
>> declaration of the `SSVARIANT` structure (where they will be at the file
>> scope)?  For both C and C++.
>>
>> I've also proposed the same thing but for C only, because such moving
>> out does not change senantics.  Had I compiled the code with nested
>> structures successfully by a C compiler, the nested structures are at
>> unit scope I believe:
>>
> 
> Yes. This results in consistent code, and doesn't bring duplication of
> the struct definition (outside the struct for C and inside it for C++).
> 
>>> 6.7.2.1 Structure and union specifiers
>>> 8 The presence of a struct-declaration-list in a
>>> struct-or-union-specifier declares a new type, within a translation unit.
>>
>> But for C++ to preserve† isolation of the nested types (as it is in the
>> original header file) we may stick with a fix I've already shown -- a
>> fix proposed by you, Hao (declaring structure types before an anonymous
>> union having members of those types).
>>
>> Therefore, I want to use `#ifdef __cplusplus` to separate these two
>> solutions.
>>
>> † 10.3.10 Nested class declarations [class.nest]
>> 1 ... The name of a nested class is local to its enclosing class.  The
>> nested class is in the scope of its enclosing class.
>>
>>
> 
> It would result in duplicated definitions which I think is pretty bad.
> 
> 


___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] Add Microsoft OLE DB driver for SQL server

2019-02-28 Thread Ruslan Garipov
did you mean the members of `struct _LBA {` in the aforementioned commit 
would be members of the enclosing `struct _PLAY_CD {`? This seems the case 
in C.


Yes, members of `_LBA` and `_MSF` becomes members of `_PLAY_CD` when 
compiling such C code with GCC on Microsoft Windows.  At least it looks 
like that, when one reads the error text.



It looks like we have ended up in a bug there


I don't know :-(  To summarize: MSVC, Intel C++ and GCC on Microsoft 
Windows fail to compile that sample C code.  But clang for Microsoft 
Windows does compile the code (just like GCC for Linux-based OSes).  
clang-cl fails to compile of course; due to the back-end shared with MSVC I 
believe.


I think we should try promoting named nested structs and unions (so they 
appear in the file scope). At least this works for both C and C++, 
providing these names don't conflict with each other.


If I understand you correctly, you propose to move declarations of the 
nested structures like `_Time2Val`, `_DateTimeVal` and so on out of 
declaration of the `SSVARIANT` structure (where they will be at the file 
scope)?  For both C and C++.


I've also proposed the same thing but for C only, because such moving out 
does not change senantics.  Had I compiled the code with nested structures 
successfully by a C compiler, the nested structures are at unit scope I 
believe:



6.7.2.1 Structure and union specifiers
8 The presence of a struct-declaration-list in a struct-or-union-specifier 
declares a new type, within a translation unit.


But for C++ to preserve† isolation of the nested types (as it is in the 
original header file) we may stick with a fix I've already shown -- a fix 
proposed by you, Hao (declaring structure types before an anonymous union 
having members of those types).


Therefore, I want to use `#ifdef __cplusplus` to separate these two solutions.

† 10.3.10 Nested class declarations [class.nest]
1 ... The name of a nested class is local to its enclosing class.  The 
nested class is in the scope of its enclosing class.



On March 1, 2019 7:42:24 AM Liu Hao  wrote:


在 2019/3/1 上午12:22, Ruslan Garipov 写道:

That commit does what you've suggested to me to fix build with g++: it
moves two structure definition out of an anonymous union.  That's what
I've done already and that's what has "broken" my C compilers on
Microsoft Windows.  But the commit 'a66e407e' is "lucky" to have those
two structures (`_LBA` and `_MSF`) having no members of the same name.
And in my case I have, for example, `_Time2Val`, `_DateTimeVal` and
`_DateTimeOffsetVal` all having the `bScale` members, which the
compilers erroneously "inserts" as members into `SSVARIANT` and,
therefore, fail with error.



... did you mean the members of `struct _LBA {` in the aforementioned
commit would be members of the enclosing `struct _PLAY_CD {`? This seems
the case in C. It looks like we have ended up in a bug there.


Thus, what about using `#ifdef __cplusplus` guard?



But I think we should try promoting named nested structs and unions (so
they appear in the file scope). At least this works for both C and C++,
providing these names don't conflict with each other.

--
Best regards,
LH_Mouse






___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] Add Microsoft OLE DB driver for SQL server

2019-02-28 Thread Ruslan Garipov
> I am not familiar with CC. Perhaps it is just a symlink to GCC

Yes, cc is a soft link to gcc.  I just got into the habit of using CC,
not GCC.  Therefore, the problem I wanted to show you in my previous
message is that GCC for Microsoft Windows can't compile the sample with
two structures nested into another one.  Just as Microsoft Visual C++
and Intel C++ (same back-end?) -- all three compilers fail to compile
the sample with ``duplicate member''/``*member* has already been
declared in the current scope'' error.  GCC for a Linux-distro target
compiles the sample without any error.

> See a66e407efbadeeca6a0bdb4fd7b39a6f8275958f . It looks like a similar
> issue

That commit does what you've suggested to me to fix build with g++: it
moves two structure definition out of an anonymous union.  That's what
I've done already and that's what has "broken" my C compilers on
Microsoft Windows.  But the commit 'a66e407e' is "lucky" to have those
two structures (`_LBA` and `_MSF`) having no members of the same name.
And in my case I have, for example, `_Time2Val`, `_DateTimeVal` and
`_DateTimeOffsetVal` all having the `bScale` members, which the
compilers erroneously "inserts" as members into `SSVARIANT` and,
therefore, fail with error.

Thus, what about using `#ifdef __cplusplus` guard?

On 2/28/2019 6:24 PM, Liu Hao wrote:
> 在 2019/2/28 下午8:23, Ruslan Garipov 写道:
>> Hello, Hao!  Thanks a lot for review!
>>
>>> This could be fixed by defining the struct inside `SSVARIANT`
>>> directly
>>
>> Yes, if I implement the `SSVARIANT` like this:
>>
>> (... abridged ...)
>>
>> g++ compiles the file just fine.  But now we get errors with cc
>> compiler:
>>
>> (... abridged ...)
>>
>> It looks like the compiler sees the both `Foo` and `Boo` type
>> declarations as declarations of *anonymous structures*, whose members
>> must be considered as members of the containing structure ([6.7.2.1] 13
>> Structure and union specifiers).
>>
>> x86_64-pc-linux-gnu-cc compiles the same code just well, without error.
>>
>> Therefore, I want to propose to use `#ifdef __cplusplus` on the updated
>> `SSVARIANT` structure shown in this post to declare "new" dedicated
>> nested structures (`_{Time2,DateTime{,Offset},NChar,...}Val`) as
>> **nested** ones only for C++, and to declare the same structures for C
>> just before the declaration of the `SSVARIANT` structure† (or to use
>> "original" version of the `SSVARIANT` structure).
>>
>> † If one moves declaration of the `Foo` and `Boo` out of the declaration
>> of the `A` structure, x86_64-w64-mingw32-cc compiles the sample.c
>> without any errors.
>>
>> What do you think about this?
>>
> 
> 
> See a66e407efbadeeca6a0bdb4fd7b39a6f8275958f . It looks like a similar
> issue, so I presume a similar solution would apply. If it fails with CC
> then probably CC is out of interest.
> 
> Hmm I am not familiar with CC. Perhaps it is just a symlink to GCC and
> GCC behaves like sort of ancient compiler if it finds itself being
> called 'CC'... ?
> 

-- 
Yours truly,
Ruslan Garipov .
--
MinGW-w64 developer, with write after approval
GEDKeeper collaborator


___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] Add Microsoft OLE DB driver for SQL server

2019-02-28 Thread Ruslan Garipov

Hello, Hao!  Thanks a lot for review!


This could be fixed by defining the struct inside `SSVARIANT`
directly


Yes, if I implement the `SSVARIANT` like this:

```
struct SSVARIANT {
 SSVARTYPE vt;
 DWORD dwReserved1;
 DWORD dwReserved2;
 struct _Time2Val {
   DBTIME2 tTime2Val;
   BYTE bScale;
 };
 struct _DateTimeVal {
   DBTIMESTAMP tsDateTimeVal;
   BYTE bScale;
 };
 struct _DateTimeOffsetVal {
   DBTIMESTAMPOFFSET tsoDateTimeOffsetVal;
   BYTE bScale;
 };
 struct _NCharVal {
   SHORT sActualLength;
   SHORT sMaxLength;
   WCHAR *pwchNCharVal;
   BYTE rgbReserved[5];
   DWORD dwReserved;
   WCHAR *pwchReserved;
 };
 struct _CharVal {
   SHORT sActualLength;
   SHORT sMaxLength;
   CHAR *pchCharVal;
   BYTE rgbReserved[5];
   DWORD dwReserved;
   WCHAR *pwchReserved;
 };
 struct _BinaryVal {
   SHORT sActualLength;
   SHORT sMaxLength;
   BYTE *prgbBinaryVal;
   DWORD dwReserved;
 };
 struct _UnknownType {
   DWORD dwActualLength;
   BYTE rgMetadata[16];
   BYTE *pUnknownData;
 };
 struct _BLOBType {
   DBOBJECT dbobj;
   IUnknown *pUnk;
 };
 union {
   BYTE bTinyIntVal;
   SHORT sShortIntVal;
   LONG lIntVal;
   LONGLONG llBigIntVal;
   FLOAT fltRealVal;
   DOUBLE dblFloatVal;
   CY cyMoneyVal;
   VARIANT_BOOL fBitVal;
   BYTE rgbGuidVal[16];
   DB_NUMERIC numNumericVal;
   DBDATE dDateVal;
   DBTIMESTAMP tsDateTimeVal;
   struct _Time2Val Time2Val;
   struct _DateTimeVal DateTimeVal;
   struct _DateTimeOffsetVal DateTimeOffsetVal;
   struct _NCharVal NCharVal;
   struct _CharVal CharVal;
   struct _BinaryVal BinaryVal;
   struct _UnknownType UnknownType;
   struct _BLOBType BLOBType;
 };
};
```

g++ compiles the file just fine.  But now we get errors with cc
compiler:

```
$ cc -std=gnu11 -Wall -Wextra -x c \
mingw-w64-headers/include/msoledbsql.h -o /dev/null
mingw-w64-headers/include/msoledbsql.h:355:10: error: duplicate member
'bScale'
BYTE bScale;
 ^~
```

This is because x86_64-w64-mingw32-cc v8.2.1 (just as v8.1.0) fails to
compile the following code (sample.c):

```
struct A
{
 struct Foo {int foo; int bar;};
 struct Boo {int boo; int bar;};
};

int
main(void)
{
 return 0;
}
```

emitting the same error as above:

```
$ cc -std=c17 -Wall -Wextra -x c sample.c -o /dev/null
sample.c:4:28: error: duplicate member 'bar'
  struct Boo {int boo; int bar;};
   ^~~
```

It looks like the compiler sees the both `Foo` and `Boo` type
declarations as declarations of *anonymous structures*, whose members
must be considered as members of the containing structure ([6.7.2.1] 13
Structure and union specifiers).

x86_64-pc-linux-gnu-cc compiles the same code just well, without error.

Therefore, I want to propose to use `#ifdef __cplusplus` on the updated
`SSVARIANT` structure shown in this post to declare "new" dedicated
nested structures (`_{Time2,DateTime{,Offset},NChar,...}Val`) as
**nested** ones only for C++, and to declare the same structures for C
just before the declaration of the `SSVARIANT` structure† (or to use
"original" version of the `SSVARIANT` structure).

† If one moves declaration of the `Foo` and `Boo` out of the declaration
of the `A` structure, x86_64-w64-mingw32-cc compiles the sample.c
without any errors.

What do you think about this?


On February 28, 2019 8:01:02 AM Liu Hao  wrote:


在 2019/2/28 4:25, Ruslan Garipov 写道:

it does apply cleanly to the master branch.
Please rebase this work against master


I believe the issue here is not the master's tip.  That's line-ending
issue.



Yes killing all CRs makes the patch apply again.

But this is unusual. Git should be able to ignore CRs before LFs.  :|



Thanks a lot!  I'll add your fix to the next version of the patch.  But
I also didn't tested it because I have no i686-w64-mingw32 toolset.
This is actually the reason why I didn't create the DEF file for x86
library by myself.

Thanks a lot for review.  I will send the new patch by the next message.
Hope it could be applied well.



The proposed patch contains an error when compiled as C++:


+struct SSVARIANT {
+  SSVARTYPE vt;
+  DWORD dwReserved1;
+  DWORD dwReserved2;
+  union {
+BYTE bTinyIntVal;
+SHORT sShortIntVal;
+LONG lIntVal;
+LONGLONG llBigIntVal;
+FLOAT fltRealVal;
+DOUBLE dblFloatVal;
+CY cyMoneyVal;
+VARIANT_BOOL fBitVal;
+BYTE rgbGuidVal[16];
+DB_NUMERIC numNumericVal;
+DBDATE dDateVal;
+DBTIMESTAMP tsDateTimeVal;
+struct _Time2Val {
+  DBTIME2 tTime2Val;
+  BYTE bScale;
+} Time2Val;


The `_Time2Val` (with a few more) would be invalid C++, as follows:

```
$ g++ -std=gnu++11 -Wall -Wextra -x c++
mingw-w64-headers/include/msoledbsql.h  -o /dev/null
mingw-w64-headers/include/msoledbsql.h:367:12: error: 'struct
SSVARIANT_DateTimeVal' invalid; an anonymous union
may only have public non-static data members [-fpermissive]
 struct _DateTimeVal {
^~~~
```

This could be fixed by defining the struct inside `SSVARIANT` 

[Mingw-w64-public] [PATCH] Add Microsoft OLE DB driver for SQL server

2019-02-27 Thread Ruslan Garipov

In August of 2011[1] Microsoft announced deprecation of the Microsoft
OLE DB Provider for SQL Server.  But in October of 2017 Microsoft had to
undeprecate[2] OLE DB data access technology releasing the ``Microsoft
OLE DB Driver for SQL Server'' known as ``msoledbsql''.

This commit adds the ``msoledbsql'' API to mingw-w64 -- the only OLE DB
data access solution supported and maintained by Microsoft now.

To provide class/interface identifiers msoledbsql.h in this commit uses
the same technique as, for example, mingw-w64's sqloledb.h file, i.e. it
uses the `DBINITCONSTANTS` guard to define identifiers only in one
module.  Original Microsoft's files (both msoledbsql.h from the new API
and sqloledb.h from Microsoft Windows 10 SDK) use
`__declspec(selectany)` to move that "burden" to the linker.

[1]: https://blogs.msdn.microsoft.com/sqlnativeclient/2011/08/29/
microsoft-is-aligning-with-odbc-for-native-relational-data-access/
[2]: https://blogs.msdn.microsoft.com/sqlnativeclient/2017/10/06/
announcing-the-new-release-of-ole-db-driver-for-sql-server/

Signed-off-by: Ruslan Garipov 
---
mingw-w64-crt/Makefile.in  |4 +-
mingw-w64-crt/lib32/Makefile.am|1 +
mingw-w64-crt/lib32/msoledbsql.def |   13 +
mingw-w64-crt/lib64/Makefile.am|1 +
mingw-w64-crt/lib64/msoledbsql.def |   13 +
mingw-w64-headers/include/msoledbsql.h | 1408 
6 files changed, 1438 insertions(+), 2 deletions(-)
create mode 100644 mingw-w64-crt/lib32/msoledbsql.def
create mode 100644 mingw-w64-crt/lib64/msoledbsql.def
create mode 100644 mingw-w64-headers/include/msoledbsql.h

diff --git a/mingw-w64-crt/Makefile.in b/mingw-w64-crt/Makefile.in
index 19c2c6f8..28399817 100644
--- a/mingw-w64-crt/Makefile.in
+++ b/mingw-w64-crt/Makefile.in
@@ -7361,7 +7361,7 @@ src_intrincsarm64 =
 @LIB32_TRUE@   lib32/libmsctf.a lib32/libmsctfmonitor.a \
 @LIB32_TRUE@   lib32/libmsdmo.a lib32/libmsdrm.a \
 @LIB32_TRUE@   lib32/libmshtml.a lib32/libmshtmled.a \
-@LIB32_TRUE@   lib32/libmsi.a lib32/libmsimg32.a \
+@LIB32_TRUE@   lib32/libmsi.a lib32/libmsimg32.a lib32/libmsoledbsql.a \
 @LIB32_TRUE@   lib32/libmstask.a lib32/libmsvfw32.a \
 @LIB32_TRUE@   lib32/libmswsock.a lib32/libncrypt.a \
 @LIB32_TRUE@   lib32/libnddeapi.a lib32/libndfapi.a \
@@ -7786,7 +7786,7 @@ src_intrincsarm64 =
 @LIB64_TRUE@   lib64/libmslbui.a lib64/libmsls31.a \
 @LIB64_TRUE@   lib64/libmsmqocm.a lib64/libmsobdl.a \
 @LIB64_TRUE@   lib64/libmsobmain.a lib64/libmsoeacct.a \
-@LIB64_TRUE@   lib64/libmsoe.a lib64/libmsoert2.a \
+@LIB64_TRUE@   lib64/libmsoe.a lib64/libmsoert2.a lib64/libmsoledbsql.a \
 @LIB64_TRUE@   lib64/libmspatcha.a lib64/libmsports.a \
 @LIB64_TRUE@   lib64/libmsrating.a lib64/libmsrle32.a \
 @LIB64_TRUE@   lib64/libmssign32.a lib64/libmssip32.a \
diff --git a/mingw-w64-crt/lib32/Makefile.am b/mingw-w64-crt/lib32/Makefile.am
index 065098f5..cb63da4f 100644
--- a/mingw-w64-crt/lib32/Makefile.am
+++ b/mingw-w64-crt/lib32/Makefile.am
@@ -178,6 +178,7 @@ lib32_DATA += %reldir%/libmshtml.a
 lib32_DATA += %reldir%/libmshtmled.a
 lib32_DATA += %reldir%/libmsi.a
 lib32_DATA += %reldir%/libmsimg32.a
+lib32_DATA += %reldir%/libmsoledbsql.a
 lib32_DATA += %reldir%/libmstask.a
 #lib32_DATA += %reldir%/libmsvcp60.a # Specialized for W32API conditional
 lib32_DATA += %reldir%/libmsvfw32.a
diff --git a/mingw-w64-crt/lib32/msoledbsql.def 
b/mingw-w64-crt/lib32/msoledbsql.def
new file mode 100644
index ..fbea8771
--- /dev/null
+++ b/mingw-w64-crt/lib32/msoledbsql.def
@@ -0,0 +1,13 @@
+;
+; Definition file of msoledbsql.dll
+; Automatic generated by gendef
+; written by Kai Tietz 2008
+;
+LIBRARY "msoledbsql.dll"
+EXPORTS
+DllCanUnloadNow@0
+DllGetClassObject@12
+DllMain@12
+DllRegisterServer@0
+DllUnregisterServer@0
+OpenSqlFilestream@24
diff --git a/mingw-w64-crt/lib64/Makefile.am b/mingw-w64-crt/lib64/Makefile.am
index 0a9c856b..772fb42a 100644
--- a/mingw-w64-crt/lib64/Makefile.am
+++ b/mingw-w64-crt/lib64/Makefile.am
@@ -348,6 +348,7 @@ lib64_DATA += %reldir%/libmsobmain.a
 lib64_DATA += %reldir%/libmsoeacct.a
 lib64_DATA += %reldir%/libmsoe.a
 lib64_DATA += %reldir%/libmsoert2.a
+lib64_DATA += %reldir%/libmsoledbsql.a
 lib64_DATA += %reldir%/libmspatcha.a
 lib64_DATA += %reldir%/libmsports.a
 lib64_DATA += %reldir%/libmsrating.a
diff --git a/mingw-w64-crt/lib64/msoledbsql.def 
b/mingw-w64-crt/lib64/msoledbsql.def
new file mode 100644
index ..c792aaff
--- /dev/null
+++ b/mingw-w64-crt/lib64/msoledbsql.def
@@ -0,0 +1,13 @@
+;
+; Definition file of msoledbsql.dll
+; Automatic generated by gendef
+; written by Kai Tietz 2008
+;
+LIBRARY "msoledbsql.dll"
+EXPORTS
+DllCanUnloadNow
+DllGetClassObject
+DllMain
+DllRegisterServer
+DllUnregisterServer
+OpenSqlFilestream
diff --git a/mingw-w64-headers/include/msoledbsql.h 
b/mingw-w64-headers/include/msoledbsql.h
new file mode 100644
index ..a826d8ca
--- /dev/null
+++ b/mingw-w64-headers/include/msoledbsql.h
@@ -0,0

Re: [Mingw-w64-public] [PATCH] Add Microsoft OLE DB driver for SQL server

2019-02-27 Thread Ruslan Garipov
> it does apply cleanly to the master branch.
> Please rebase this work against master

I believe the issue here is not the master's tip.  That's line-ending
issue.

Before I sent the original patch here, I had created it on top of
'ce5078c9' commit.  This was and currently is the head.

After I had got your reply, I downloaded the DIFF from my own e-mail and
tried to apply the patch to the head by myself:

$ git pull origin master
$ patch -u -p 1 < 0001-Add-...diff
$ git apply 0001-Add-...diff

where the `patch` warned about CRs in the DIFF, but applied the patch;
and `git-apply(1)` failed to patch the files with "trailing whitespaces"
error.

Therefore, I modified both two last commands to:

$ tr -d '\r' < 0001-Add-...diff | patch -u -p1
$ tr -d '\r' < 0001-Add-...diff  | git apply -

And now any of the commands patches the files successfully.

That all is really strange because I didn't change my workflow, so I
sent the patch as usual: I created a patch using `git-format-patch(1)`
and then `git-imap-send(1)` it.  `git-format-patch(1)` creates a file
with LF as line-ending.  After I send the file using `git-imap-send(1)`
(with msys2 or Arch Linux's git), I get a new e-mail in the ``Drafts''
with CRLF as line-endings in the patch part of the e-mail (CRLF in an
e-mail is okay, as far as I know, but may be I'm wrong).

I'm sorry, but now I really don't know how to send the patch with LF
line-endings, so you can apply my patch...  I rechecked my old patches
and other people's patches in this mailing list -- it looks like they
all have CRLF as line-endings.  I'm totally confused now.

> The x86 import library was absent

Yes, that's my fault.

> I have attached an (albeit untested) one, generated using 'gendef'
> from the x86 DLL.

Thanks a lot!  I'll add your fix to the next version of the patch.  But
I also didn't tested it because I have no i686-w64-mingw32 toolset.
This is actually the reason why I didn't create the DEF file for x86
library by myself.

Thanks a lot for review.  I will send the new patch by the next message.
Hope it could be applied well.

-- 
Yours truly,
Ruslan Garipov .
--
MinGW-w64 developer, with write after approval
GEDKeeper collaborator


___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] Add Microsoft OLE DB driver for SQL server

2019-02-27 Thread Ruslan Garipov

In August of 2011[1] Microsoft announced deprecation of the Microsoft
OLE DB Provider for SQL Server.  But in October of 2017 Microsoft had to
undeprecate[2] OLE DB data access technology releasing the ``Microsoft
OLE DB Driver for SQL Server'' known as ``msoledbsql''.

This commit adds the ``msoledbsql'' API to mingw-w64 -- the only OLE DB
data access solution supported and maintained by Microsoft now.

To provide class/interface identifiers msoledbsql.h in this commit uses
the same technique as, for example, mingw-w64's sqloledb.h file, i.e. it
uses the `DBINITCONSTANTS` guard to define identifiers only in one
module.  Original Microsoft's files (both msoledbsql.h from the new API
and sqloledb.h from Microsoft Windows 10 SDK) use
`__declspec(selectany)` to move that "burden" to the linker.

[1]: https://blogs.msdn.microsoft.com/sqlnativeclient/2011/08/29/
microsoft-is-aligning-with-odbc-for-native-relational-data-access/
[2]: https://blogs.msdn.microsoft.com/sqlnativeclient/2017/10/06/
announcing-the-new-release-of-ole-db-driver-for-sql-server/

Signed-off-by: Ruslan Garipov 
---
mingw-w64-crt/Makefile.in  |2 +-
mingw-w64-crt/lib64/Makefile.am|1 +
mingw-w64-crt/lib64/msoledbsql.def |   13 +
mingw-w64-headers/include/msoledbsql.h | 1408 
4 files changed, 1423 insertions(+), 1 deletion(-)
create mode 100644 mingw-w64-crt/lib64/msoledbsql.def
create mode 100644 mingw-w64-headers/include/msoledbsql.h

diff --git a/mingw-w64-crt/Makefile.in b/mingw-w64-crt/Makefile.in
index 19c2c6f8..29a63704 100644
--- a/mingw-w64-crt/Makefile.in
+++ b/mingw-w64-crt/Makefile.in
@@ -7786,7 +7786,7 @@ src_intrincsarm64 =
 @LIB64_TRUE@   lib64/libmslbui.a lib64/libmsls31.a \
 @LIB64_TRUE@   lib64/libmsmqocm.a lib64/libmsobdl.a \
 @LIB64_TRUE@   lib64/libmsobmain.a lib64/libmsoeacct.a \
-@LIB64_TRUE@   lib64/libmsoe.a lib64/libmsoert2.a \
+@LIB64_TRUE@   lib64/libmsoe.a lib64/libmsoert2.a lib64/libmsoledbsql.a \
 @LIB64_TRUE@   lib64/libmspatcha.a lib64/libmsports.a \
 @LIB64_TRUE@   lib64/libmsrating.a lib64/libmsrle32.a \
 @LIB64_TRUE@   lib64/libmssign32.a lib64/libmssip32.a \
diff --git a/mingw-w64-crt/lib64/Makefile.am b/mingw-w64-crt/lib64/Makefile.am
index 0a9c856b..772fb42a 100644
--- a/mingw-w64-crt/lib64/Makefile.am
+++ b/mingw-w64-crt/lib64/Makefile.am
@@ -348,6 +348,7 @@ lib64_DATA += %reldir%/libmsobmain.a
 lib64_DATA += %reldir%/libmsoeacct.a
 lib64_DATA += %reldir%/libmsoe.a
 lib64_DATA += %reldir%/libmsoert2.a
+lib64_DATA += %reldir%/libmsoledbsql.a
 lib64_DATA += %reldir%/libmspatcha.a
 lib64_DATA += %reldir%/libmsports.a
 lib64_DATA += %reldir%/libmsrating.a
diff --git a/mingw-w64-crt/lib64/msoledbsql.def 
b/mingw-w64-crt/lib64/msoledbsql.def
new file mode 100644
index ..c792aaff
--- /dev/null
+++ b/mingw-w64-crt/lib64/msoledbsql.def
@@ -0,0 +1,13 @@
+;
+; Definition file of msoledbsql.dll
+; Automatic generated by gendef
+; written by Kai Tietz 2008
+;
+LIBRARY "msoledbsql.dll"
+EXPORTS
+DllCanUnloadNow
+DllGetClassObject
+DllMain
+DllRegisterServer
+DllUnregisterServer
+OpenSqlFilestream
diff --git a/mingw-w64-headers/include/msoledbsql.h 
b/mingw-w64-headers/include/msoledbsql.h
new file mode 100644
index ..a826d8ca
--- /dev/null
+++ b/mingw-w64-headers/include/msoledbsql.h
@@ -0,0 +1,1408 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
+#endif
+
+#include "rpc.h"
+#include "rpcndr.h"
+
+#ifndef __RPCNDR_H_VERSION__
+#error This stub requires an updated version of 
+#endif
+
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif
+
+#ifndef __msoledbsql_h__
+#define __msoledbsql_h__
+
+#ifndef __ICommandWithParameters_FWD_DEFINED__
+#define __ICommandWithParameters_FWD_DEFINED__
+typedef struct ICommandWithParameters ICommandWithParameters;
+#endif
+
+#ifndef __IUMSInitialize_FWD_DEFINED__
+#define __IUMSInitialize_FWD_DEFINED__
+typedef struct IUMSInitialize IUMSInitialize;
+#endif
+
+#ifndef __ISQLServerErrorInfo_FWD_DEFINED__
+#define __ISQLServerErrorInfo_FWD_DEFINED__
+typedef struct ISQLServerErrorInfo ISQLServerErrorInfo;
+#endif
+
+#ifndef __IRowsetFastLoad_FWD_DEFINED__
+#define __IRowsetFastLoad_FWD_DEFINED__
+typedef struct IRowsetFastLoad IRowsetFastLoad;
+#endif
+
+#ifndef __ISchemaLock_FWD_DEFINED__
+#define __ISchemaLock_FWD_DEFINED__
+typedef struct ISchemaLock ISchemaLock;
+#endif
+
+#ifndef __IBCPSession_FWD_DEFINED__
+#define __IBCPSession_FWD_DEFINED__
+typedef struct IBCPSession IBCPSession;
+#endif
+
+#ifndef __IBCPSession2_FWD_DEFINED__
+#define __IBCPSession2_FWD_DEFINED__
+typedef struct IBCPSession2 IBCPSession2;
+#endif
+
+#ifndef __ISSAbort_FWD_DEFINED__
+#define __ISSAb

[Mingw-w64-public] [PATCH] Add missed OLE DB identifiers (addition)

2019-02-14 Thread Ruslan Garipov

This commit continues changes started in the commit '2a93d84215' and
adds another missed identifiers of OLE DB interfaces, exported by
Microsoft Windows' uuid.lib but lacking in mingw-w64's uuid.lib.

While here, I swap `#include`s of  and  to order
the `#include`s alphabetically.

Signed-off-by: Ruslan Garipov 
---
mingw-w64-crt/libsrc/uuid.c | 88 -
1 file changed, 87 insertions(+), 1 deletion(-)

diff --git a/mingw-w64-crt/libsrc/uuid.c b/mingw-w64-crt/libsrc/uuid.c
index 97c288ef..0466925f 100644
--- a/mingw-w64-crt/libsrc/uuid.c
+++ b/mingw-w64-crt/libsrc/uuid.c
@@ -21,10 +21,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
-#include 
 #include 
+#include 
 
 
DEFINE_GUID(ARRAYID_PathProperties,0x7ecbba04,0x2d97,0x11cf,0xa2,0x29,0,0xaa,0,0x3d,0x73,0x52);
 
DEFINE_GUID(CATID_InternetAware,0xde86a58,0x2baa,0x11cf,0xa2,0x29,0,0xaa,0,0x3d,0x73,0x52);
@@ -293,3 +294,88 @@ 
DEFINE_GUID(CLSID_DataLinks,0x2206cdb2,0x19c1,0x11d1,0x89,0xe0,0x00,0xc0,0x4f,0x
 
DEFINE_GUID(CLSID_RootBinder,0xff151822,0xb0bf,0x11d1,0xa8,0x0d,0x00,0x00,0x00,0x00,0x00,0x00);
 
DEFINE_GUID(IID_IDataInitialize,0x2206ccb1,0x19c1,0x11d1,0x89,0xe0,0x00,0xc0,0x4f,0xd7,0xa8,0x29);
 
DEFINE_GUID(IID_IDBInitialize,0x0c733a8b,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IAccessor,0x0c733a8c,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IRowset,0x0c733a7c,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IRowsetInfo,0x0c733a55,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IRowsetLocate,0x0c733a7d,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IRowsetResynch,0x0c733a84,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IRowsetScroll,0x0c733a7e,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IRowsetChange,0x0c733a05,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IRowsetUpdate,0x0c733a6d,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IRowsetIdentity,0x0c733a09,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IRowsetNotify,0x0c733a83,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IRowsetIndex,0x0c733a82,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_ICommand,0x0c733a63,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IMultipleResults,0x0c733a90,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IConvertType,0x0c733a88,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_ICommandPrepare,0x0c733a26,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_ICommandProperties,0x0c733a79,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_ICommandText,0x0c733a27,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_ICommandWithParameters,0x0c733a64,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IColumnsRowset,0x0c733a10,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IColumnsInfo,0x0c733a11,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IDBCreateCommand,0x0c733a1d,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IDBCreateSession,0x0c733a5d,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_ISourcesRowset,0x0c733a1e,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IDBProperties,0x0c733a8a,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IDBInfo,0x0c733a89,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IDBDataSourceAdmin,0x0c733a7a,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_ISessionProperties,0x0c733a85,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IIndexDefinition,0x0c733a68,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_ITableDefinition,0x0c733a86,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IOpenRowset,0x0c733a69,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IDBSchemaRowset,0x0c733a7b,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IErrorRecords,0x0c733a67,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IErrorLookup,0x0c733a66,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_ISQLErrorInfo,0x0c733a74,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_IGetDataSource,0x0c733a75,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_ITransactionLocal,0x0c733a5f,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID(IID_ITransactionJoin,0x0c733a5e,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
+DEFINE_GUID

[Mingw-w64-public] [PATCH] Add missed OLE DB identifiers

2019-02-12 Thread Ruslan Garipov

Microsoft Windows 10 SDK v10.0.17763 (and may be elder ones) defines the
`CLSID_MSDAINITIALIZE`, `CLSID_DataLinks`, `CLSID_RootBinder`,
`IID_IDataInitialize` and `IID_IDBInitialize` as public symbols in the
uuid.lib.  I added them to mingw-w64's uuid.lib because currently the
latter doesn't have the GUIDs defined.

Signed-off-by: Ruslan Garipov 
---
mingw-w64-crt/libsrc/uuid.c | 5 +
1 file changed, 5 insertions(+)

diff --git a/mingw-w64-crt/libsrc/uuid.c b/mingw-w64-crt/libsrc/uuid.c
index 18cd1278..97c288ef 100644
--- a/mingw-w64-crt/libsrc/uuid.c
+++ b/mingw-w64-crt/libsrc/uuid.c
@@ -288,3 +288,8 @@ 
DEFINE_GUID(CLSID_StdGlobalInterfaceTable,0x0323,0x,0x,0xc0,0x00,0x0
 
DEFINE_GUID(IID_ICallFrameEvents,0xfd5e0843,0xfc91,0x11d0,0x97,0xd7,0x00,0xc0,0x4f,0xb9,0x61,0x8a);
 
DEFINE_GUID(IID_ICallFrameWalker,0x08b23919,0x392d,0x11d2,0xb8,0xa4,0x00,0xc0,0x4f,0xb9,0x61,0x8a);
 
DEFINE_GUID(IID_ICallInterceptor,0x60c7ca75,0x896d,0x11d2,0xb8,0xb6,0x00,0xc0,0x4f,0xb9,0x61,0x8a);
+DEFINE_GUID(CLSID_MSDAINITIALIZE,0x2206cdb0,0x19c1,0x11d1,0x89,0xe0,0x00,0xc0,0x4f,0xd7,0xa8,0x29);
+DEFINE_GUID(CLSID_DataLinks,0x2206cdb2,0x19c1,0x11d1,0x89,0xe0,0x00,0xc0,0x4f,0xd7,0xa8,0x29);
+DEFINE_GUID(CLSID_RootBinder,0xff151822,0xb0bf,0x11d1,0xa8,0x0d,0x00,0x00,0x00,0x00,0x00,0x00);
+DEFINE_GUID(IID_IDataInitialize,0x2206ccb1,0x19c1,0x11d1,0x89,0xe0,0x00,0xc0,0x4f,0xd7,0xa8,0x29);
+DEFINE_GUID(IID_IDBInitialize,0x0c733a8b,0x2a1c,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d);
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] Add missed OLE DB identifiers

2019-02-11 Thread Ruslan Garipov

Microsoft Windows 10 SDK v10.0.17763 defines the `CLSID_MSDAINITIALIZE`
and `IID_IDataInitialize` as public symbols in the uuid.lib.  I added
them to mingw-w64's uuid.lib because currently the latter doesn't have
the GUIDs defined.

Signed-off-by: Ruslan Garipov 
---
mingw-w64-crt/libsrc/uuid.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/mingw-w64-crt/libsrc/uuid.c b/mingw-w64-crt/libsrc/uuid.c
index 18cd1278..1d4be452 100644
--- a/mingw-w64-crt/libsrc/uuid.c
+++ b/mingw-w64-crt/libsrc/uuid.c
@@ -288,3 +288,5 @@ 
DEFINE_GUID(CLSID_StdGlobalInterfaceTable,0x0323,0x,0x,0xc0,0x00,0x0
 
DEFINE_GUID(IID_ICallFrameEvents,0xfd5e0843,0xfc91,0x11d0,0x97,0xd7,0x00,0xc0,0x4f,0xb9,0x61,0x8a);
 
DEFINE_GUID(IID_ICallFrameWalker,0x08b23919,0x392d,0x11d2,0xb8,0xa4,0x00,0xc0,0x4f,0xb9,0x61,0x8a);
 
DEFINE_GUID(IID_ICallInterceptor,0x60c7ca75,0x896d,0x11d2,0xb8,0xb6,0x00,0xc0,0x4f,0xb9,0x61,0x8a);
+DEFINE_GUID(CLSID_MSDAINITIALIZE,0x2206cdb0,0x19c1,0x11d1,0x89,0xe0,0x00,0xc0,0x4f,0xd7,0xa8,0x29);
+DEFINE_GUID(IID_IDataInitialize,0x2206ccb1,0x19c1,0x11d1,0x89,0xe0,0x00,0xc0,0x4f,0xd7,0xa8,0x29);
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] Add missed functions to retrieve pseudo-handles

2018-09-27 Thread Ruslan Garipov
Then these functions should be placed in an `#if ... #endif` block, 
whose condition is `_WIN32_WINNT >= 0x0602`.


They are already ``there''; I have added these functions into 
**existed** define-guard with condition you specified. Here, this is the 
original file before my changes (with line numbers):


> 146 #if _WIN32_WINNT >= 0x0602
> 147   WINBASEAPI VOID WINAPI GetCurrentThreadStackLimits ...
> 148   WINBASEAPI WINBOOL WINAPI SetProcessMitigationPolicy ...
> 149   WINBASEAPI WINBOOL WINAPI GetProcessMitigationPolicy ...
> 150 #endif

And, according to my diff, the patch begins at line #150:


@@ -147,6 +147,19 ...
   WINBASEAPI VOID WINAPI GetCurrentThreadStackLimits ...
   WINBASEAPI WINBOOL WINAPI SetProcessMitigationPolicy ...
   WINBASEAPI WINBOOL WINAPI GetProcessMitigationPolicy ...
+
...


... and ends just before that `#endif` from above. Therefore, all three 
functions were placed into the `#if _WIN32_WINNT >= 0x0602` define-guard.


Also, all three functions in my patch are located within this block:

#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)

, while Microsoft Windows SDK 10 puts them into this one:

#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | 
WINAPI_PARTITION_SYSTEM)


The latter `WINAPI_PARTITION_SYSTEM` stands for ``System application'' 
and currently it is not used in mingw-w64, I believe.


On 9/27/2018 4:30 PM, Liu Hao wrote:

在 2018/9/27 16:41, Ruslan Garipov 写道:

This patch adds functions to retrieve pseudo-handles of process or/and
threads used to specify their tokens.

The functions are missed in the mingw-w64's headers but exist in headers
of Microsoft Windows SDK v10.0.14393.0 and later. According to the
original (Windows SDK's) file ``processthreadsapi.h'' the function are
available starting from Microsoft Windows 8, but I did not found them in
Microsoft Windows SDK 8 header file(s).

Signed-off-by: Ruslan Garipov 
---
mingw-w64-headers/include/processthreadsapi.h | 13 +
1 file changed, 13 insertions(+)




Then these functions should be placed in an `#if ... #endif` block,
whose condition is `_WIN32_WINNT >= 0x0602`.





--
Yours truly,
Ruslan Garipov .
--
MinGW-w64 developer, with write after approval
GEDKeeper collaborator


___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] Add missed functions to retrieve pseudo-handles

2018-09-27 Thread Ruslan Garipov

This patch adds functions to retrieve pseudo-handles of process or/and
threads used to specify their tokens.

The functions are missed in the mingw-w64's headers but exist in headers
of Microsoft Windows SDK v10.0.14393.0 and later. According to the
original (Windows SDK's) file ``processthreadsapi.h'' the function are
available starting from Microsoft Windows 8, but I did not found them in
Microsoft Windows SDK 8 header file(s).

Signed-off-by: Ruslan Garipov 
---
mingw-w64-headers/include/processthreadsapi.h | 13 +
1 file changed, 13 insertions(+)

diff --git a/mingw-w64-headers/include/processthreadsapi.h 
b/mingw-w64-headers/include/processthreadsapi.h
index c4629f75f9..87f7a0b55e 100644
--- a/mingw-w64-headers/include/processthreadsapi.h
+++ b/mingw-w64-headers/include/processthreadsapi.h
@@ -147,6 +147,19 @@ WINBASEAPI WINBOOL WINAPI TerminateProcess (HANDLE 
hProcess, UINT uExitCode);
   WINBASEAPI VOID WINAPI GetCurrentThreadStackLimits (PULONG_PTR LowLimit, 
PULONG_PTR HighLimit);
   WINBASEAPI WINBOOL WINAPI SetProcessMitigationPolicy 
(PROCESS_MITIGATION_POLICY MitigationPolicy, PVOID lpBuffer, SIZE_T dwLength);
   WINBASEAPI WINBOOL WINAPI GetProcessMitigationPolicy (HANDLE hProcess, 
PROCESS_MITIGATION_POLICY MitigationPolicy, PVOID lpBuffer, SIZE_T dwLength);
+
+  FORCEINLINE HANDLE GetCurrentProcessToken (VOID)
+  {
+return (HANDLE)(LONG_PTR) (-4);
+  }
+  FORCEINLINE HANDLE GetCurrentThreadToken (VOID)
+  {
+return (HANDLE)(LONG_PTR) (-5);
+  }
+  FORCEINLINE HANDLE GetCurrentThreadEffectiveToken (VOID)
+  {
+return (HANDLE)(LONG_PTR) (-6);
+  }
 #endif
 
 #endif
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] Error with evntrace.h

2018-08-29 Thread Ruslan Garipov
The struct `WNODE_HEADER` and the enumeration `WMIDPREQUESTCODE` are 
defined in ``wmistr.h'' file.


File ``evntrace.h'' includes ``wmistr.h'' one using the following 
define-guard:


mingw-w64:

```
#ifndef _EVNTRACE_KERNEL_MODE
#include 
#endif
```

Microsoft Windows 10.0.17134 SDK:

```
#if !defined(_EVNTRACE_KERNEL_MODE)
#include 
#endif
```

Therefore, to compile your code successfully you must have 
`_EVNTRACE_KERNEL_MODE` defined I believe.


On 8/29/2018 12:36 PM, Biswapriyo Nath wrote:

When I include `evntrace.h` gcc shows these errors:

```
In file included from TraceEvent.h:10:0,
  from main.h:4,
  from main.c:1:
e:\mingw64\x86_64-w64-mingw32\include\evntrace.h:513:3: error: unknown
type name 'WNODE_HEADER'
WNODE_HEADER Wnode;
^
e:\mingw64\x86_64-w64-mingw32\include\evntrace.h:608:38: error:
unknown type name 'WMIDPREQUESTCODE'
  typedef ULONG (WINAPI *WMIDPREQUEST)(WMIDPREQUESTCODE
RequestCode,PVOID RequestContext,ULONG *BufferSize,PVOID Buffer);
   ^
In file included from TraceEvent.h:10:0,
  from main.h:4,
  from main.c:1:
e:\mingw64\x86_64-w64-mingw32\include\evntrace.h:767:43: error:
unknown type name 'WMIDPREQUEST'
  EXTERN_C ULONG WMIAPI RegisterTraceGuidsW(WMIDPREQUEST
RequestAddress,PVOID RequestContext,LPCGUID ControlGuid,ULONG
GuidCount,PTRACE_GUID_REGISTRATION TraceGuidReg,LPCWSTR
MofImagePath,LPCWSTR MofResourceName,PTRACEHANDLE RegistrationHandle);
^
e:\mingw64\x86_64-w64-mingw32\include\evntrace.h:768:43: error:
unknown type name 'WMIDPREQUEST'
  EXTERN_C ULONG WMIAPI RegisterTraceGuidsA(WMIDPREQUEST
RequestAddress,PVOID RequestContext,LPCGUID ControlGuid,ULONG
GuidCount,PTRACE_GUID_REGISTRATION TraceGuidReg,LPCSTR
MofImagePath,LPCSTR MofResourceName,PTRACEHANDLE RegistrationHandle);
^
```

May be there are some errors in the evntrace.h file. Or am I doing
anything wrong?

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] GDB and Microsoft Windows thread pool

2018-03-21 Thread Ruslan Garipov

On March 21, 2018 5:33:58 PM "Liu Hao"  wrote:

Confirmed on Windows 7 x64 Professional with GDB 8.1 (Git master). This
looks like a GDB bug, please file a bug report with the testcase at
.

I reported it as the bug 22992[1].

Thanks a lot for support!

[1]: https://sourceware.org/bugzilla/show_bug.cgi?id=22992



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] GDB and Microsoft Windows thread pool

2018-03-20 Thread Ruslan Garipov
SourceForge has removed the attachment from my previous post,
therefore I post link to the sample code here:
https://pastebin.com/6xKTiK9D.

Sorry.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] GDB and Microsoft Windows thread pool

2018-03-20 Thread Ruslan Garipov
As it was suggested on the project's IRC channel, I am opening a preliminary
discussion of my issue in this mailing list.

I encountered an internal GDB error while was debugging C++ code using Microsoft
Windows thread pool API[1]. When several works/threads hit the same breakpoint
at the same time, I got the following GDB error:

> ../../../../src/gdb-8.0.1/gdb/infrun.c:5575: internal-error: int 
> finish_step_over(execution_control_state*): Assertion 
> `ecs->event_thread->control.trap_expected' failed.

Detailed information and sample code come below.

Compiler: mingw-w64 GCC (7.1 - 7.3); GDB (8.0.1 and 8.1); host OS is Microsoft
Windows 10 x64.

There is the sample code in the attachment. The code initializes thread pool
object and runs three background threads/works that almost do nothing. The
problem appears if one set a breakpoint (with the `break`, `dprintf`, etc.)
inside the thread's callback function. When the threads hit that breakpoint at
the same time, the internal error raises. The works submitted to the execution
in the `for` loop, because usually the error appears on the second submitting
and rarely on the first (see output log below).

Command line to compile the sample:

```
g++ -x c++ -std=gnu++1z -m64 -gdwarf -g3
-D_WIN32_WINNT=_WIN32_WINNT_WIN10 -DWINVER=_WIN32_WINNT_WIN10 -DDEBUG
sample.cxx
```

Below is dump of a GDB session:

```
D:\p>gdb -se a.exe
GNU gdb (GDB) 8.0.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from a.exe...done.
(gdb) dprintf sample.cxx:22, "[a] In a background thread.\n"
Dprintf 1 at 0x401574: file sample.cxx, line 22.
(gdb) r
Starting program: D:\p\a.exe
[New Thread 11420.0x308c]
[New Thread 11420.0x21f0]
[New Thread 11420.0x2c18]
[New Thread 11420.0x1a48]
[New Thread 11420.0x2c80]
[New Thread 11420.0x1b04]
[a] In a background thread.
[a] In a background thread.
[New Thread 11420.0x2404]
[a] In a background thread.
[a] In a background thread.
../../../../src/gdb-8.0.1/gdb/infrun.c:5575: internal-error: int
finish_step_over(execution_control_state*): Assertion
`ecs->event_thread->control.trap_expected' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) y

This is a bug, please report it.  For instructions, see:
.

../../../../src/gdb-8.0.1/gdb/infrun.c:5575: internal-error: int
finish_step_over(execution_control_state*): Assertion
`ecs->event_thread->control.trap_expected' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) n
```

In the session above the error raised on the second work submitting (the first
iteration of the loop was OK).

I tried different compiler version (7.1, 7.2 and 7.3) with different thread
models of the runtime (posix and win-32); different version of GDB (8.0.1, 8.1
and 7.9 shipped with Intel C++ compiler (gdb-ia)) and I always got the same
result -- internal error of GDB.

And now I cannot debug my program without ugly workarounds... Any help will be
appreciated.

Thanks!

[1] 
https://msdn.microsoft.com/en-us/library/windows/desktop/ms686766(v=vs.85).aspx
"Thread Pool API"
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] uianimation.h: Add missed defines

2018-02-27 Thread Ruslan Garipov

Hi, Jacek!

Thanks a lot for your help: I had to use `const`ants and not `define`s, 
that was my error. Since my patch for the header file was previously marked 
as "ok", I will push my patch (for 'uianimation.h' only) without waiting 
for your patch (for 'uianimation.idl').


(I executed `widl` explicitly but since I had used `define`s I had no luck)

Thanks!



On February 28, 2018 3:27:06 AM Jacek Caban <ja...@codeweavers.com> wrote:


Hi Ruslan,


Those are actually constants in IDL file that widl translates to
defined. I sent a patch to IDL file.


Headers are not generated in default build, they are stored in git
instead. To generate them, you need to have widl available and configure
mingw-w64 with --with-widl option. Then you can generate header like:

make include/uianimation.h


Thanks,

Jacek


On 2/19/18 3:40 PM, Ruslan Garipov wrote:

Hi, Jacek! It looks like I don't understand something with IDL or
'widl', but if I add those `define`s into the IDL file they do **not**
appear in the result header file (i.e. "result file" of the 'widl').

Can you help me with that?


On February 19, 2018 2:07:03 AM Jacek Caban <ja...@codeweavers.com>
wrote:


Hi Ruslan,


On 2/17/18 5:45 PM, Ruslan Garipov wrote:

diff --git a/mingw-w64-headers/include/uianimation.h
b/mingw-w64-headers/include/uianimation.h
index 5fce04b9..7893ba56 100644
--- a/mingw-w64-headers/include/uianimation.h
+++ b/mingw-w64-headers/include/uianimation.h


Please fix the IDL file instead of an autogenerated header.

Thanks,
Jacek









--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] uianimation.h: Add missed defines

2018-02-27 Thread Ruslan Garipov
Hi, Jacek! It looks like I don't understand something with IDL or 'widl', 
but if I add those `define`s into the IDL file they do **not** appear in 
the result header file (i.e. "result file" of the 'widl').


Can you help me with that?


On February 19, 2018 2:07:03 AM Jacek Caban <ja...@codeweavers.com> wrote:


Hi Ruslan,


On 2/17/18 5:45 PM, Ruslan Garipov wrote:
diff --git a/mingw-w64-headers/include/uianimation.h 
b/mingw-w64-headers/include/uianimation.h

index 5fce04b9..7893ba56 100644
--- a/mingw-w64-headers/include/uianimation.h
+++ b/mingw-w64-headers/include/uianimation.h


Please fix the IDL file instead of an autogenerated header.

Thanks,
Jacek




--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] uianimation.h: Add missed defines

2018-02-18 Thread Ruslan Garipov

This commit adds missed (somehow) defines for the Microsoft Windows
Animation Manager like `UI_ANIMATION_REPEAT_INDEFINITELY`,
`UI_ANIMATION_KEYFRAME_STORYBOARD_START`, and so on.

Signed-off-by: Ruslan Garipov <ruslanngari...@gmail.com>
---
  mingw-w64-headers/include/uianimation.h | 5 +
  1 file changed, 5 insertions(+)

diff --git a/mingw-w64-headers/include/uianimation.h b/mingw-w64-headers/include/uianimation.h
index 5fce04b9..7893ba56 100644
--- a/mingw-w64-headers/include/uianimation.h
+++ b/mingw-w64-headers/include/uianimation.h
@@ -475,6 +475,11 @@ typedef struct __WIDL_uianimation_generated_name_000E {
 int _;
 } *UI_ANIMATION_KEYFRAME;
 
+#define UI_ANIMATION_KEYFRAME_STORYBOARD_START ( ( UI_ANIMATION_KEYFRAME )-1 )
+#define UI_ANIMATION_REPEAT_INDEFINITELY ( -1 )
+#define UI_ANIMATION_REPEAT_INDEFINITELY_CONCLUDE_AT_END ( UI_ANIMATION_REPEAT_INDEFINITELY )
+#define UI_ANIMATION_REPEAT_INDEFINITELY_CONCLUDE_AT_START ( -2 )
+
 DEFINE_GUID(LIBID_uianimation, 0x44ca24db, 0x1a92, 0x4149, 0xba,0xb5, 0xfb,0x14,0xd6,0x4b,0x40,0x1e);
 
 /*


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] uianimation.h: Add missed defines

2018-02-18 Thread Ruslan Garipov


This commit adds missed (somehow) defines for the Microsoft Windows
Animation Manager like `UI_ANIMATION_REPEAT_INDEFINITELY`,
`UI_ANIMATION_KEYFRAME_STORYBOARD_START`, and so on.

Signed-off-by: Ruslan Garipov <ruslanngari...@gmail.com>
---
 mingw-w64-headers/include/uianimation.h | 5 +
 1 file changed, 5 insertions(+)


diff --git a/mingw-w64-headers/include/uianimation.h b/mingw-w64-headers/include/uianimation.h
index 5fce04b9..7893ba56 100644
--- a/mingw-w64-headers/include/uianimation.h
+++ b/mingw-w64-headers/include/uianimation.h
@@ -475,6 +475,11 @@ typedef struct __WIDL_uianimation_generated_name_000E {
 int _;
 } *UI_ANIMATION_KEYFRAME;
 
+#define UI_ANIMATION_KEYFRAME_STORYBOARD_START ( ( UI_ANIMATION_KEYFRAME )-1 )
+#define UI_ANIMATION_REPEAT_INDEFINITELY ( -1 )
+#define UI_ANIMATION_REPEAT_INDEFINITELY_CONCLUDE_AT_END ( UI_ANIMATION_REPEAT_INDEFINITELY )
+#define UI_ANIMATION_REPEAT_INDEFINITELY_CONCLUDE_AT_START ( -2 )
+
 DEFINE_GUID(LIBID_uianimation, 0x44ca24db, 0x1a92, 0x4149, 0xba,0xb5, 0xfb,0x14,0xd6,0x4b,0x40,0x1e);
 
 /*

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] Add declaration of `ID2D1Multithread` interface

2017-07-25 Thread Ruslan Garipov
This commit declares interface `ID2D1Multithread` missing in mingw-w64's  
'd2d1_1.h', allowing the client code to use "stock" Direct2D factory lock 
when one does an operation on a Direct3D or DXGI surface.


Signed-off-by: ‡Ruslan Garipov <ruslanngari...@gmail.com>
---
mingw-w64-headers/include/d2d1_1.h | 19 +++
1 file changed, 19 insertions(+)

Please review.
diff --git a/mingw-w64-headers/include/d2d1_1.h 
b/mingw-w64-headers/include/d2d1_1.h
index 2eb398a0f..3e504c2de 100644
--- a/mingw-w64-headers/include/d2d1_1.h
+++ b/mingw-w64-headers/include/d2d1_1.h
@@ -1007,6 +1007,25 @@ typedef interface ID2D1Factory1 ID2D1Factory1;
 DEFINE_GUID(IID_ID2D1Factory1, 
0xbb12d362,0xdaee,0x4b9a,0xaa,0x1d,0x14,0xba,0x40,0x1c,0xfa,0x1f);
 __CRT_UUID_DECL(ID2D1Factory1, 
0xbb12d362,0xdaee,0x4b9a,0xaa,0x1d,0x14,0xba,0x40,0x1c,0xfa,0x1f);
 
+#ifndef D2D_USE_C_DEFINITIONS
+
+interface ID2D1Multithread : public IUnknown
+{
+STDMETHOD_(BOOL, GetMultithreadProtected)() CONST PURE;
+STDMETHOD_(void, Enter)() PURE;
+STDMETHOD_(void, Leave)() PURE;
+};
+
+#else
+
+typedef interface ID2D1Multithread ID2D1Multithread;
+/* FIXME: Add full C declaration */
+
+#endif
+
+DEFINE_GUID(IID_ID2D1Multithread, 
0x31e6e7bc,0xe0ff,0x4d46,0x8c,0x64,0xa0,0xa8,0xc4,0x1c,0x15,0xd3);
+__CRT_UUID_DECL(ID2D1Multithread, 
0x31e6e7bc,0xe0ff,0x4d46,0x8c,0x64,0xa0,0xa8,0xc4,0x1c,0x15,0xd3);
+
 #include 
 
 #endif
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] Add 'Windows Animation Manager' UUIDs

2017-07-25 Thread Ruslan Garipov

This commit adds missed in [3fee81] identifiers of Windows Animation
Manager classes and interfaces. To access the UUIDs the client must
link in 'uuid' library.

Signed-off-by: Ruslan Garipov <ruslanngari...@gmail.com>
---
mingw-w64-crt/Makefile.am   | 18 +-
mingw-w64-crt/Makefile.in   | 56 
+++-
mingw-w64-crt/libsrc/uianimation-uuid.c | 44 


3 files changed, 100 insertions(+), 18 deletions(-)
create mode 100644 mingw-w64-crt/libsrc/uianimation-uuid.c

This patch completes commit [3f3381] by adding the necessary symbols
into the library 'uuid'. Actually this message pings this patch:
[[PATCH 1/2] Add 'Windows Animation Manager' header file] [1].

The patch contains several "inherited" whitespace errors -- they
existed in the original Makefiles and I just repeated them in my
changes.

Please review.

[1]: https://sourceforge.net/p/mingw-w64/mailman/message/35943361/
"[PATCH 1/2] Add 'Windows Animation Manager' header file"
diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index e00ac8cf..8b6df25d 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -121,15 +121,15 @@ src_libmingwthrd=libsrc/mingwthrd_mt.c
 src_libgdiplus=libsrc/gdiplus.c
 
 src_libuuid=\
-  libsrc/ativscp-uuid.c   libsrc/atsmedia-uuid.c  libsrc/bth-uuid.c   
libsrc/cguid-uuid.c libsrc/comcat-uuid.c  \
-  libsrc/devguid.clibsrc/docobj-uuid.clibsrc/dxva-uuid.c  
libsrc/exdisp-uuid.clibsrc/extras-uuid.c  \
-  libsrc/fwp-uuid.c   libsrc/guid_nul.c   libsrc/hlguids-uuid.c   
libsrc/hlink-uuid.c libsrc/mlang-uuid.c   \
-  libsrc/msctf-uuid.c libsrc/mshtmhst-uuid.c  libsrc/mshtml-uuid.c
libsrc/msxml-uuid.c libsrc/netcon-uuid.c  \
-  libsrc/ntddkbd-uuid.c   libsrc/ntddmou-uuid.c   libsrc/ntddpar-uuid.c   
libsrc/ntddscsi-uuid.c  libsrc/ntddser-uuid.c \
-  libsrc/ntddstor-uuid.c  libsrc/ntddvdeo-uuid.c  libsrc/oaidl-uuid.c 
libsrc/objidl-uuid.clibsrc/objsafe-uuid.c \
-  libsrc/ocidl-uuid.c libsrc/oleacc-uuid.clibsrc/olectlid-uuid.c  
libsrc/oleidl-uuid.clibsrc/power-uuid.c   \
-  libsrc/powrprof-uuid.c  libsrc/usbcamdi-uuid.c  libsrc/usbiodef-uuid.c  
libsrc/uuid.c \
-  libsrc/vds-uuid.c   libsrc/virtdisk-uuid.c  libsrc/wia-uuid.c
+  libsrc/ativscp-uuid.c   libsrc/atsmedia-uuid.clibsrc/bth-uuid.c   
libsrc/cguid-uuid.c libsrc/comcat-uuid.c  \
+  libsrc/devguid.clibsrc/docobj-uuid.c  libsrc/dxva-uuid.c  
libsrc/exdisp-uuid.clibsrc/extras-uuid.c  \
+  libsrc/fwp-uuid.c   libsrc/guid_nul.c libsrc/hlguids-uuid.c   
libsrc/hlink-uuid.c libsrc/mlang-uuid.c   \
+  libsrc/msctf-uuid.c libsrc/mshtmhst-uuid.clibsrc/mshtml-uuid.c
libsrc/msxml-uuid.c libsrc/netcon-uuid.c  \
+  libsrc/ntddkbd-uuid.c   libsrc/ntddmou-uuid.c libsrc/ntddpar-uuid.c   
libsrc/ntddscsi-uuid.c  libsrc/ntddser-uuid.c \
+  libsrc/ntddstor-uuid.c  libsrc/ntddvdeo-uuid.clibsrc/oaidl-uuid.c 
libsrc/objidl-uuid.clibsrc/objsafe-uuid.c \
+  libsrc/ocidl-uuid.c libsrc/oleacc-uuid.c  libsrc/olectlid-uuid.c  
libsrc/oleidl-uuid.clibsrc/power-uuid.c   \
+  libsrc/powrprof-uuid.c  libsrc/uianimation-uuid.c libsrc/usbcamdi-uuid.c  
libsrc/usbiodef-uuid.c  libsrc/uuid.c \
+  libsrc/vds-uuid.c   libsrc/virtdisk-uuid.clibsrc/wia-uuid.c
 
 src_libws2_32=libsrc/ws2_32.c \
   \
diff --git a/mingw-w64-crt/Makefile.in b/mingw-w64-crt/Makefile.in
index 549d83b2..a257c238 100644
--- a/mingw-w64-crt/Makefile.in
+++ b/mingw-w64-crt/Makefile.in
@@ -1276,6 +1276,7 @@ am__lib32_libuuid_a_SOURCES_DIST = libsrc/ativscp-uuid.c \
libsrc/ocidl-uuid.c libsrc/oleacc-uuid.c \
libsrc/olectlid-uuid.c libsrc/oleidl-uuid.c \
libsrc/power-uuid.c libsrc/powrprof-uuid.c \
+   libsrc/uianimation-uuid.c \
libsrc/usbcamdi-uuid.c libsrc/usbiodef-uuid.c libsrc/uuid.c \
libsrc/vds-uuid.c libsrc/virtdisk-uuid.c libsrc/wia-uuid.c
 am__objects_33 = libsrc/lib32_libuuid_a-ativscp-uuid.$(OBJEXT) \
@@ -1314,6 +1315,7 @@ am__objects_33 = 
libsrc/lib32_libuuid_a-ativscp-uuid.$(OBJEXT) \
libsrc/lib32_libuuid_a-oleidl-uuid.$(OBJEXT) \
libsrc/lib32_libuuid_a-power-uuid.$(OBJEXT) \
libsrc/lib32_libuuid_a-powrprof-uuid.$(OBJEXT) \
+   libsrc/lib32_libuuid_a-uianimation-uuid.$(OBJEXT) \
libsrc/lib32_libuuid_a-usbcamdi-uuid.$(OBJEXT) \
libsrc/lib32_libuuid_a-usbiodef-uuid.$(OBJEXT) \
libsrc/lib32_libuuid_a-uuid.$(OBJEXT) \
@@ -2442,6 +2444,7 @@ am__lib64_libuuid_a_SOURCES_DIST = libsrc/ativscp-uuid.c \
libsrc/ocidl-uuid.c libsrc/oleacc-uuid.c \
libsrc/olectlid-uuid.c libsrc/oleidl-uuid.c \
libsrc/power-uuid.c libsrc/powrprof-uuid.c \
+   libsrc/uianimation-uuid.c \
libsrc/usbcamdi-uuid.c libsrc/usbiodef-uuid.c libsrc/uuid.c \
  

[Mingw-w64-public] [PING^2] [PATCH 2/2] Add 'Windows Animation Manager' IDL file

2017-07-24 Thread Ruslan Garipov
This is updated IDL file. I did not ping the patch with the header and 
Makefiles because the header file is generated from the IDL one without 
further modifications. The Makefiles were not changed since the initial 
patch. But if this is necessary I can ping the updated patch #1 with the 
header and Makefiles.


I'm sorry for bother, but I really need `WAM' being in mingw-w64 for my 
current project.


Please review.


This is the second commit in the series that adds support of Windows
Animation Manager (WAM) into mingw-w64.

Signed-off-by: Ruslan Garipov <ruslanngari...@gmail.com>

mingw-w64-headers/include/uianimation.idl | 1242
+
1 file changed, 1242 insertions(+)
create mode 100644 mingw-w64-headers/include/uianimation.idl





--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] MFTEnumEx in lib64 / lib 32

2017-07-24 Thread Ruslan Garipov
a few other functions appeared, too. Perhaps they're unique to the current 
'fast ring' insider build of Windows 10?


I think some functions are just missed from the mingw-w64's libraries. Just 
like `MFTEnumEx`. I will check them today a little bit later. The patch for 
`MFTEnumEx` is in the master branch now.




On July 24, 2017 12:42:05 PM John Warburton <j...@johnwarburton.net> wrote:


On Sun, Jul 23, 2017 at 5:44 PM, Ruslan Garipov
<ruslanngari...@gmail.com> wrote:


Like this, I believe -- a `git-format-patch` included.



On 23.07.2017 19:54, John Warburton wrote:

While cross-compiling a program that required the function MFTEnumEx
from the Microsoft Media Foundation Transform framework, I noticed
that it occurs only in the arm32 import library -- to be precise,
mingw-w64-crt/libarm32/mfplat.def. It isn't in lib64 or lib32.


Thank you very much for this patch, Ruslan. It indeed permits my
program to compile against mingw-w64 now!

While trying...

gendef /mnt/c/Windows/System32/mfplat.dll

...followed by...

x86_64-w64-mingw32-dlltool -k --output-lib libmfplat.a --def mfplat.def

...a few other functions appeared, too. Perhaps they're unique to the
current 'fast ring' insider build of Windows 10?

I have attached the whole .def file in case it's of interest.
with best wishes,
JW



--
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


--
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public





--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] MFTEnumEx in lib64 / lib 32

2017-07-23 Thread Ruslan Garipov

Like this, I believe -- a `git-format-patch` included.

On 23.07.2017 19:54, John Warburton wrote:

Hello,

While cross-compiling a program that required the function MFTEnumEx
from the Microsoft Media Foundation Transform framework, I noticed
that it occurs only in the arm32 import library -- to be precise,
mingw-w64-crt/libarm32/mfplat.def. It isn't in lib64 or lib32.

The function is declared correctly in include/mfapi.h. And a related
function, MFTEnum, is present.

Is there a reason for the omission of MFTEnumEx in the lib32 and lib64
import libraries, or is it possible for me to learn how to put it in
place, and submit a patch to you?

JW


From 8738f55854e8012a57e0cf65b06b45889c4d Mon Sep 17 00:00:00 2001
From: Ruslan Garipov <ruslanngari...@gmail.com>
Date: Sun, 23 Jul 2017 21:33:25 +0500
Subject: [PATCH] Add `MFTEnumEx` to import libraries (x86-64, x86)
To: mingw-w64-public@lists.sourceforge.net
Cc: ruslanngari...@gmail.com
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="2.13.3"

This is a multi-part message in MIME format.
--2.13.3
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit


Signed-off-by: Ruslan Garipov <ruslanngari...@gmail.com>
---
 mingw-w64-crt/lib32/mfplat.def | 1 +
 mingw-w64-crt/lib64/mfplat.def | 1 +
 2 files changed, 2 insertions(+)


--2.13.3
Content-Type: text/x-patch; 
name="0001-Add-MFTEnumEx-to-import-libraries-x86-64-x86.diff"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; 
filename="0001-Add-MFTEnumEx-to-import-libraries-x86-64-x86.diff"

diff --git a/mingw-w64-crt/lib32/mfplat.def b/mingw-w64-crt/lib32/mfplat.def
index 19828106..2e29ad8a 100644
--- a/mingw-w64-crt/lib32/mfplat.def
+++ b/mingw-w64-crt/lib32/mfplat.def
@@ -118,6 +118,7 @@ MFShutdown@0
 MFStartup@8
 MFStreamDescriptorProtectMediaType@8
 MFTEnum@40
+MFTEnumEx@36
 MFTGetInfo@40
 MFTRegister@60
 MFTUnregister@16
diff --git a/mingw-w64-crt/lib64/mfplat.def b/mingw-w64-crt/lib64/mfplat.def
index 57da4cd5..d6ba3a58 100644
--- a/mingw-w64-crt/lib64/mfplat.def
+++ b/mingw-w64-crt/lib64/mfplat.def
@@ -118,6 +118,7 @@ MFShutdown
 MFStartup
 MFStreamDescriptorProtectMediaType
 MFTEnum
+MFTEnumEx
 MFTGetInfo
 MFTRegister
 MFTUnregister

--2.13.3--


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PING] [PATCH 2/2] Add 'Windows Animation Manager' IDL file

2017-07-18 Thread Ruslan Garipov
This is updated IDL file. I did not ping the patch with the header and 
Makefiles -- firstly, one can find the updated patch for those files in 
this list among recent messages, secondly, the header file is generated 
from the IDL one without further modifications.


I'm sorry for bother, but I really need `WAM' being in mingw-w64 for my 
current project.


Please review.


This is the second commit in the series that adds support of Windows
Animation Manager (WAM) into mingw-w64.

Signed-off-by: Ruslan Garipov <ruslanngari...@gmail.com>

  mingw-w64-headers/include/uianimation.idl | 1242
+
  1 file changed, 1242 insertions(+)
  create mode 100644 mingw-w64-headers/include/uianimation.idl



diff --git a/mingw-w64-headers/include/uianimation.idl 
b/mingw-w64-headers/include/uianimation.idl
new file mode 100644
index ..505ad9dc
--- /dev/null
+++ b/mingw-w64-headers/include/uianimation.idl
@@ -0,0 +1,1242 @@
+/**
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+import "unknwn.idl";
+
+/* Interface forward declarations. */
+interface IUIAnimationManager;
+interface IUIAnimationVariable;
+interface IUIAnimationStoryboard;
+interface IUIAnimationTransition;
+interface IUIAnimationStoryboardEventHandler;
+interface IUIAnimationVariableChangeHandler;
+interface IUIAnimationVariableIntegerChangeHandler;
+interface IUIAnimationManagerEventHandler;
+interface IUIAnimationPriorityComparison;
+interface IUIAnimationManager2;
+interface IUIAnimationVariable2;
+interface IDCompositionAnimation;
+interface IUIAnimationStoryboard2;
+interface IUIAnimationTransition2;
+interface IUIAnimationLoopIterationChangeHandler2;
+interface IUIAnimationStoryboardEventHandler2;
+interface IUIAnimationVariableChangeHandler2;
+interface IUIAnimationVariableIntegerChangeHandler2;
+interface IUIAnimationVariableCurveChangeHandler2;
+interface IUIAnimationManagerEventHandler2;
+interface IUIAnimationPriorityComparison2;
+interface IUIAnimationTransitionLibrary;
+interface IUIAnimationTransitionLibrary2;
+interface IUIAnimationTransitionFactory;
+interface IUIAnimationInterpolator;
+interface IUIAnimationTransitionFactory2;
+interface IUIAnimationInterpolator2;
+interface IUIAnimationPrimitiveInterpolation;
+interface IUIAnimationTimer;
+interface IUIAnimationTimerUpdateHandler;
+interface IUIAnimationTimerClientEventHandler;
+interface IUIAnimationTimerEventHandler;
+
+/* Coclass record forward declarations. */
+coclass UIAnimationManager;
+coclass UIAnimationManager2;
+coclass UIAnimationTransitionLibrary;
+coclass UIAnimationTransitionLibrary2;
+coclass UIAnimationTransitionFactory;
+coclass UIAnimationTransitionFactory2;
+coclass UIAnimationTimer;
+
+typedef DOUBLE UI_ANIMATION_SECONDS;
+
+/* Enumeration declarations. */
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_SCHEDULING_UNEXPECTED_FAILURE = 0,
+  UI_ANIMATION_SCHEDULING_INSUFFICIENT_PRIORITY = 1,
+  UI_ANIMATION_SCHEDULING_ALREADY_SCHEDULED = 2,
+  UI_ANIMATION_SCHEDULING_SUCCEEDED = 3,
+  UI_ANIMATION_SCHEDULING_DEFERRED = 4
+} UI_ANIMATION_SCHEDULING_RESULT;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_STORYBOARD_BUILDING = 0,
+  UI_ANIMATION_STORYBOARD_SCHEDULED = 1,
+  UI_ANIMATION_STORYBOARD_CANCELLED = 2,
+  UI_ANIMATION_STORYBOARD_PLAYING = 3,
+  UI_ANIMATION_STORYBOARD_TRUNCATED = 4,
+  UI_ANIMATION_STORYBOARD_FINISHED = 5,
+  UI_ANIMATION_STORYBOARD_READY = 6,
+  UI_ANIMATION_STORYBOARD_INSUFFICIENT_PRIORITY = 7
+} UI_ANIMATION_STORYBOARD_STATUS;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_ROUNDING_NEAREST = 0,
+  UI_ANIMATION_ROUNDING_FLOOR = 1,
+  UI_ANIMATION_ROUNDING_CEILING = 2
+} UI_ANIMATION_ROUNDING_MODE;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_UPDATE_NO_CHANGE = 0,
+  UI_ANIMATION_UPDATE_VARIABLES_CHANGED = 1
+} UI_ANIMATION_UPDATE_RESULT;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_MANAGER_IDLE = 0,
+  UI_ANIMATION_MANAGER_BUSY = 1
+} UI_ANIMATION_MANAGER_STATUS;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_MODE_DISABLED = 0,
+  UI_ANIMATION_MODE_SYSTEM_DEFAULT = 1,
+  UI_ANIMATION_MODE_ENABLED = 2
+} UI_ANIMATION_MODE;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_PRIORITY_EFFECT_FAILURE = 0,
+  UI_ANIMATION_PRIORITY_EFFECT_DELAY = 1
+} UI_ANIMATION_PRIORITY_EFFECT;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_REPEAT_MODE_NORMAL = 0,
+  UI_ANIMATION_REPEAT_MODE_ALTERNATE = 1
+} UI_ANIMATION_REPEAT_MODE;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_SLOPE_INCREASING = 0,
+  UI_ANIMATION_SLOPE_DECREASING = 1
+} UI_ANIMATION_SLOPE;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_DEPENDENCY_NONE = 0,
+  UI_ANIMATION_DEPENDENCY_INTERMEDIATE_VALUES = 0x1,
+  UI_ANIMATION_DEPENDENCY_FINAL_VALUE = 0x2,
+  UI_ANIMATION_DEPENDENCY_FINAL_VELOCITY = 0x4,
+  UI_ANIMATION_DEPENDENCY_DURATION = 0x8
+} UI_ANIMATION_DEPENDENCIES;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_TIMER_CLIENT_IDLE = 0,
+  UI_ANIMATION_TIMER_CLIENT_BUSY = 1
+} UI_ANIMATION_TIM

Re: [Mingw-w64-public] [PATCH 0/2] Add 'Windows Animation Manager' classes/interfaces

2017-07-13 Thread Ruslan Garipov
Had I added the attachment to this post, I ended up with the issue that 
caused me to split the original single commit on to two ones -- such 
message will exceed size limit of 512 KB per message in this list.


Thus, attachment you are looking for are in the next messages: "[PATCH 
1/2] Add 'Windows Animation Manager' header file" and "[PATCH 2/2] Add 
'Windows Animation Manager' IDL file". But this, "[PATCH 0/2] Add 
'Windows Animation Manager' classes/interfaces" is just a cover letter 
created by `git-format-patch`.


On 13.07.2017 23:29, The Canadian Bacon wrote:

You're missing your attachment on this one.

On Jul 13, 2017 11:05 AM, "Ruslan Garipov" <ruslanngari...@gmail.com> wrote:



This is a series of commits that introduces [Windows Animation Manager]
[1] (WAM) support into MinGW-w64. WAM is a COM based framework, and I
created IDL and header files from scratch, since I did not find the
files in Wine.

I created 'uianimation.idl' file with 'genidl' tool from
'UIAnimation.dll' library from Microsoft Windows 10 SKU. The result IDL
file was then slightly modified (I replaced some keywords in a way
'widl' would "understand" the file and remove some typedefs that may
cause compilation errors). Then I generated 'uianimation.h' with 'widl'
compiler from the updated 'uianimation.idl'. The result header
'uianimation.h' was not modified after that.

I have tried to send those changes as one commit, but I ended up with
patch size limitation on mingw-w64 `public' mailing list. I couldn't
send the signle-commit-patch since e-mail with that patch slightly
exceeded 512 KB. As it was advised on mingw-w64 IRC chat, I split the
patch on to two parts.

There are some whitespace errors in the patch, but they appear because
such errors exist in the original Makefiles. I just "repeated" them.

Please review.

[1]:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd3
71981(v=vs.85).aspx
"Windows Animation Manager"

Ruslan Garipov (2):
  Add 'Windows Animation Manager' header file
  Add 'Windows Animation Manager' IDL file

mingw-w64-crt/Makefile.am |   18 +-
mingw-w64-crt/Makefile.in |   56 +-
mingw-w64-crt/libsrc/uianimation-uuid.c   |   44 +
mingw-w64-headers/Makefile.am |1 +
mingw-w64-headers/Makefile.in |1 +
mingw-w64-headers/include/uianimation.h   | 7325
+
mingw-w64-headers/include/uianimation.idl | 1291 +
7 files changed, 8718 insertions(+), 18 deletions(-)
create mode 100644 mingw-w64-crt/libsrc/uianimation-uuid.c
create mode 100644 mingw-w64-headers/include/uianimation.h
create mode 100644 mingw-w64-headers/include/uianimation.idl





--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public



--
Yours truly,
Ruslan Garipov .
--
MinGW-w64 developer, with write after approval
GEDKeeper collaborator

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH 2/2] Add 'Windows Animation Manager' IDL file

2017-07-13 Thread Ruslan Garipov


This is the second commit in the series that adds support of Windows
Animation Manager (WAM) into mingw-w64.

Signed-off-by: Ruslan Garipov <ruslanngari...@gmail.com>
---
Hi Jacek! Thanks for reviewing. I've implemented your proposals. And
also fixed erroneous values of the enum members ('genidl' wrote wrong
values there).

This is updated IDL file. The header and Makefiles come next.

(I messed the previous message up, sorry)

Please review.
---
 mingw-w64-headers/include/uianimation.idl | 1242 
+

 1 file changed, 1242 insertions(+)
 create mode 100644 mingw-w64-headers/include/uianimation.idl


diff --git a/mingw-w64-headers/include/uianimation.idl b/mingw-w64-headers/include/uianimation.idl
new file mode 100644
index ..505ad9dc
--- /dev/null
+++ b/mingw-w64-headers/include/uianimation.idl
@@ -0,0 +1,1242 @@
+/**
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+import "unknwn.idl";
+
+/* Interface forward declarations. */
+interface IUIAnimationManager;
+interface IUIAnimationVariable;
+interface IUIAnimationStoryboard;
+interface IUIAnimationTransition;
+interface IUIAnimationStoryboardEventHandler;
+interface IUIAnimationVariableChangeHandler;
+interface IUIAnimationVariableIntegerChangeHandler;
+interface IUIAnimationManagerEventHandler;
+interface IUIAnimationPriorityComparison;
+interface IUIAnimationManager2;
+interface IUIAnimationVariable2;
+interface IDCompositionAnimation;
+interface IUIAnimationStoryboard2;
+interface IUIAnimationTransition2;
+interface IUIAnimationLoopIterationChangeHandler2;
+interface IUIAnimationStoryboardEventHandler2;
+interface IUIAnimationVariableChangeHandler2;
+interface IUIAnimationVariableIntegerChangeHandler2;
+interface IUIAnimationVariableCurveChangeHandler2;
+interface IUIAnimationManagerEventHandler2;
+interface IUIAnimationPriorityComparison2;
+interface IUIAnimationTransitionLibrary;
+interface IUIAnimationTransitionLibrary2;
+interface IUIAnimationTransitionFactory;
+interface IUIAnimationInterpolator;
+interface IUIAnimationTransitionFactory2;
+interface IUIAnimationInterpolator2;
+interface IUIAnimationPrimitiveInterpolation;
+interface IUIAnimationTimer;
+interface IUIAnimationTimerUpdateHandler;
+interface IUIAnimationTimerClientEventHandler;
+interface IUIAnimationTimerEventHandler;
+
+/* Coclass record forward declarations. */
+coclass UIAnimationManager;
+coclass UIAnimationManager2;
+coclass UIAnimationTransitionLibrary;
+coclass UIAnimationTransitionLibrary2;
+coclass UIAnimationTransitionFactory;
+coclass UIAnimationTransitionFactory2;
+coclass UIAnimationTimer;
+
+typedef DOUBLE UI_ANIMATION_SECONDS;
+
+/* Enumeration declarations. */
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_SCHEDULING_UNEXPECTED_FAILURE = 0,
+  UI_ANIMATION_SCHEDULING_INSUFFICIENT_PRIORITY = 1,
+  UI_ANIMATION_SCHEDULING_ALREADY_SCHEDULED = 2,
+  UI_ANIMATION_SCHEDULING_SUCCEEDED = 3,
+  UI_ANIMATION_SCHEDULING_DEFERRED = 4
+} UI_ANIMATION_SCHEDULING_RESULT;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_STORYBOARD_BUILDING = 0,
+  UI_ANIMATION_STORYBOARD_SCHEDULED = 1,
+  UI_ANIMATION_STORYBOARD_CANCELLED = 2,
+  UI_ANIMATION_STORYBOARD_PLAYING = 3,
+  UI_ANIMATION_STORYBOARD_TRUNCATED = 4,
+  UI_ANIMATION_STORYBOARD_FINISHED = 5,
+  UI_ANIMATION_STORYBOARD_READY = 6,
+  UI_ANIMATION_STORYBOARD_INSUFFICIENT_PRIORITY = 7
+} UI_ANIMATION_STORYBOARD_STATUS;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_ROUNDING_NEAREST = 0,
+  UI_ANIMATION_ROUNDING_FLOOR = 1,
+  UI_ANIMATION_ROUNDING_CEILING = 2
+} UI_ANIMATION_ROUNDING_MODE;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_UPDATE_NO_CHANGE = 0,
+  UI_ANIMATION_UPDATE_VARIABLES_CHANGED = 1
+} UI_ANIMATION_UPDATE_RESULT;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_MANAGER_IDLE = 0,
+  UI_ANIMATION_MANAGER_BUSY = 1
+} UI_ANIMATION_MANAGER_STATUS;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_MODE_DISABLED = 0,
+  UI_ANIMATION_MODE_SYSTEM_DEFAULT = 1,
+  UI_ANIMATION_MODE_ENABLED = 2
+} UI_ANIMATION_MODE;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_PRIORITY_EFFECT_FAILURE = 0,
+  UI_ANIMATION_PRIORITY_EFFECT_DELAY = 1
+} UI_ANIMATION_PRIORITY_EFFECT;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_REPEAT_MODE_NORMAL = 0,
+  UI_ANIMATION_REPEAT_MODE_ALTERNATE = 1
+} UI_ANIMATION_REPEAT_MODE;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_SLOPE_INCREASING = 0,
+  UI_ANIMATION_SLOPE_DECREASING = 1
+} UI_ANIMATION_SLOPE;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_DEPENDENCY_NONE = 0,
+  UI_ANIMATION_DEPENDENCY_INTERMEDIATE_VALUES = 0x1,
+  UI_ANIMATION_DEPENDENCY_FINAL_VALUE = 0x2,
+  UI_ANIMATION_DEPENDENCY_FINAL_VELOCITY = 0x4,
+  UI_ANIMATION_DEPENDENCY_DURATION = 0x8
+} UI_ANIMATION_DEPENDENCIES;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_TIMER_CLIENT_IDLE = 0,
+  UI_ANIMATION_TIMER_CLIENT_BUSY = 1
+} UI_ANIMATION_TIMER_CLIENT_STATUS;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_IDLE_BEHAV

Re: [Mingw-w64-public] [PATCH 2/2] Add 'Windows Animation Manager' IDL file

2017-07-13 Thread Ruslan Garipov


This is the second commit in the series that adds support of Windows
Animation Manager (WAM) into mingw-w64.

Signed-off-by: Ruslan Garipov <ruslanngari...@gmail.com>
---
Hi Jacek! Thanks for reviewing. I've implemented your proposals. And 
also fixed erroneous values of the enum members ('genidl' wrote wrong 
values there).


This is updated IDL file. The header and Makefiles come next.

Please review.
---
 mingw-w64-headers/include/uianimation.idl | 1242 
+

 1 file changed, 1242 insertions(+)
 create mode 100644 mingw-w64-headers/include/uianimation.idl


diff --git a/mingw-w64-headers/include/uianimation.idl b/mingw-w64-headers/include/uianimation.idl
new file mode 100644
index ..505ad9dc
--- /dev/null
+++ b/mingw-w64-headers/include/uianimation.idl
@@ -0,0 +1,1242 @@
+/**
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+import "unknwn.idl";
+
+/* Interface forward declarations. */
+interface IUIAnimationManager;
+interface IUIAnimationVariable;
+interface IUIAnimationStoryboard;
+interface IUIAnimationTransition;
+interface IUIAnimationStoryboardEventHandler;
+interface IUIAnimationVariableChangeHandler;
+interface IUIAnimationVariableIntegerChangeHandler;
+interface IUIAnimationManagerEventHandler;
+interface IUIAnimationPriorityComparison;
+interface IUIAnimationManager2;
+interface IUIAnimationVariable2;
+interface IDCompositionAnimation;
+interface IUIAnimationStoryboard2;
+interface IUIAnimationTransition2;
+interface IUIAnimationLoopIterationChangeHandler2;
+interface IUIAnimationStoryboardEventHandler2;
+interface IUIAnimationVariableChangeHandler2;
+interface IUIAnimationVariableIntegerChangeHandler2;
+interface IUIAnimationVariableCurveChangeHandler2;
+interface IUIAnimationManagerEventHandler2;
+interface IUIAnimationPriorityComparison2;
+interface IUIAnimationTransitionLibrary;
+interface IUIAnimationTransitionLibrary2;
+interface IUIAnimationTransitionFactory;
+interface IUIAnimationInterpolator;
+interface IUIAnimationTransitionFactory2;
+interface IUIAnimationInterpolator2;
+interface IUIAnimationPrimitiveInterpolation;
+interface IUIAnimationTimer;
+interface IUIAnimationTimerUpdateHandler;
+interface IUIAnimationTimerClientEventHandler;
+interface IUIAnimationTimerEventHandler;
+
+/* Coclass record forward declarations. */
+coclass UIAnimationManager;
+coclass UIAnimationManager2;
+coclass UIAnimationTransitionLibrary;
+coclass UIAnimationTransitionLibrary2;
+coclass UIAnimationTransitionFactory;
+coclass UIAnimationTransitionFactory2;
+coclass UIAnimationTimer;
+
+typedef DOUBLE UI_ANIMATION_SECONDS;
+
+/* Enumeration declarations. */
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_SCHEDULING_UNEXPECTED_FAILURE = 0,
+  UI_ANIMATION_SCHEDULING_INSUFFICIENT_PRIORITY = 1,
+  UI_ANIMATION_SCHEDULING_ALREADY_SCHEDULED = 2,
+  UI_ANIMATION_SCHEDULING_SUCCEEDED = 3,
+  UI_ANIMATION_SCHEDULING_DEFERRED = 4
+} UI_ANIMATION_SCHEDULING_RESULT;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_STORYBOARD_BUILDING = 0,
+  UI_ANIMATION_STORYBOARD_SCHEDULED = 1,
+  UI_ANIMATION_STORYBOARD_CANCELLED = 2,
+  UI_ANIMATION_STORYBOARD_PLAYING = 3,
+  UI_ANIMATION_STORYBOARD_TRUNCATED = 4,
+  UI_ANIMATION_STORYBOARD_FINISHED = 5,
+  UI_ANIMATION_STORYBOARD_READY = 6,
+  UI_ANIMATION_STORYBOARD_INSUFFICIENT_PRIORITY = 7
+} UI_ANIMATION_STORYBOARD_STATUS;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_ROUNDING_NEAREST = 0,
+  UI_ANIMATION_ROUNDING_FLOOR = 1,
+  UI_ANIMATION_ROUNDING_CEILING = 2
+} UI_ANIMATION_ROUNDING_MODE;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_UPDATE_NO_CHANGE = 0,
+  UI_ANIMATION_UPDATE_VARIABLES_CHANGED = 1
+} UI_ANIMATION_UPDATE_RESULT;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_MANAGER_IDLE = 0,
+  UI_ANIMATION_MANAGER_BUSY = 1
+} UI_ANIMATION_MANAGER_STATUS;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_MODE_DISABLED = 0,
+  UI_ANIMATION_MODE_SYSTEM_DEFAULT = 1,
+  UI_ANIMATION_MODE_ENABLED = 2
+} UI_ANIMATION_MODE;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_PRIORITY_EFFECT_FAILURE = 0,
+  UI_ANIMATION_PRIORITY_EFFECT_DELAY = 1
+} UI_ANIMATION_PRIORITY_EFFECT;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_REPEAT_MODE_NORMAL = 0,
+  UI_ANIMATION_REPEAT_MODE_ALTERNATE = 1
+} UI_ANIMATION_REPEAT_MODE;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_SLOPE_INCREASING = 0,
+  UI_ANIMATION_SLOPE_DECREASING = 1
+} UI_ANIMATION_SLOPE;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_DEPENDENCY_NONE = 0,
+  UI_ANIMATION_DEPENDENCY_INTERMEDIATE_VALUES = 0x1,
+  UI_ANIMATION_DEPENDENCY_FINAL_VALUE = 0x2,
+  UI_ANIMATION_DEPENDENCY_FINAL_VELOCITY = 0x4,
+  UI_ANIMATION_DEPENDENCY_DURATION = 0x8
+} UI_ANIMATION_DEPENDENCIES;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_TIMER_CLIENT_IDLE = 0,
+  UI_ANIMATION_TIMER_CLIENT_BUSY = 1
+} UI_ANIMATION_TIMER_CLIENT_STATUS;
+typedef [v1_enum] enum
+{
+  UI_ANIMATION_IDLE_BEHAVIOR_CONTINUE = 0,
+  UI_ANIMATION_IDLE_BEHA

[Mingw-w64-public] [PATCH 2/2] Add 'Windows Animation Manager' IDL file

2017-07-13 Thread Ruslan Garipov


This is the second commit in the series that adds support of Windows
Animation Manager (WAM) into mingw-w64.

Signed-off-by: Ruslan Garipov <ruslanngari...@gmail.com>
---
mingw-w64-headers/include/uianimation.idl | 1291 +
1 file changed, 1291 insertions(+)
create mode 100644 mingw-w64-headers/include/uianimation.idl

diff --git a/mingw-w64-headers/include/uianimation.idl 
b/mingw-w64-headers/include/uianimation.idl
new file mode 100644
index ..25d97f95
--- /dev/null
+++ b/mingw-w64-headers/include/uianimation.idl
@@ -0,0 +1,1291 @@
+/**
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+import "unknwn.idl";
+
+/* Interface forward declarations.  */
+interface IUIAnimationManager;
+interface IUIAnimationVariable;
+interface IUIAnimationStoryboard;
+interface IUIAnimationTransition;
+interface IUIAnimationStoryboardEventHandler;
+interface IUIAnimationVariableChangeHandler;
+interface IUIAnimationVariableIntegerChangeHandler;
+interface IUIAnimationManagerEventHandler;
+interface IUIAnimationPriorityComparison;
+interface IUIAnimationManager2;
+interface IUIAnimationVariable2;
+interface IDCompositionAnimation;
+interface IUIAnimationStoryboard2;
+interface IUIAnimationTransition2;
+interface IUIAnimationLoopIterationChangeHandler2;
+interface IUIAnimationStoryboardEventHandler2;
+interface IUIAnimationVariableChangeHandler2;
+interface IUIAnimationVariableIntegerChangeHandler2;
+interface IUIAnimationVariableCurveChangeHandler2;
+interface IUIAnimationManagerEventHandler2;
+interface IUIAnimationPriorityComparison2;
+interface IUIAnimationTransitionLibrary;
+interface IUIAnimationTransitionLibrary2;
+interface IUIAnimationTransitionFactory;
+interface IUIAnimationInterpolator;
+interface IUIAnimationTransitionFactory2;
+interface IUIAnimationInterpolator2;
+interface IUIAnimationPrimitiveInterpolation;
+interface IUIAnimationTimer;
+interface IUIAnimationTimerUpdateHandler;
+interface IUIAnimationTimerClientEventHandler;
+interface IUIAnimationTimerEventHandler;
+
+/* Structure forward declarations.  */
+typedef struct __MIDL___MIDL_itf_UIAnimation__0002_0003 
__MIDL___MIDL_itf_UIAnimation__0002_0003;
+
+/* Coclass record forward declarations.  */
+coclass UIAnimationManager;
+coclass UIAnimationManager2;
+coclass UIAnimationTransitionLibrary;
+coclass UIAnimationTransitionLibrary2;
+coclass UIAnimationTransitionFactory;
+coclass UIAnimationTransitionFactory2;
+coclass UIAnimationTimer;
+
+typedef DOUBLE UI_ANIMATION_SECONDS;
+
+/* Enumeration declarations.  */
+enum __MIDL___MIDL_itf_UIAnimation__0002_0002
+{
+  UI_ANIMATION_SCHEDULING_UNEXPECTED_FAILURE = (int) 0xc00,
+  UI_ANIMATION_SCHEDULING_INSUFFICIENT_PRIORITY = (int) 0xc01,
+  UI_ANIMATION_SCHEDULING_ALREADY_SCHEDULED = (int) 0xc02,
+  UI_ANIMATION_SCHEDULING_SUCCEEDED = (int) 0xc03,
+  UI_ANIMATION_SCHEDULING_DEFERRED = (int) 0xc04
+};
+enum __MIDL___MIDL_itf_UIAnimation__0002_0001
+{
+  UI_ANIMATION_STORYBOARD_BUILDING = (int) 0xc00,
+  UI_ANIMATION_STORYBOARD_SCHEDULED = (int) 0xc01,
+  UI_ANIMATION_STORYBOARD_CANCELLED = (int) 0xc02,
+  UI_ANIMATION_STORYBOARD_PLAYING = (int) 0xc03,
+  UI_ANIMATION_STORYBOARD_TRUNCATED = (int) 0xc04,
+  UI_ANIMATION_STORYBOARD_FINISHED = (int) 0xc05,
+  UI_ANIMATION_STORYBOARD_READY = (int) 0xc06,
+  UI_ANIMATION_STORYBOARD_INSUFFICIENT_PRIORITY = (int) 0xc07
+};
+enum __MIDL___MIDL_itf_UIAnimation__0001_0001
+{
+  UI_ANIMATION_ROUNDING_NEAREST = (int) 0xc00,
+  UI_ANIMATION_ROUNDING_FLOOR = (int) 0xc01,
+  UI_ANIMATION_ROUNDING_CEILING = (int) 0xc02
+};
+enum __MIDL___MIDL_itf_UIAnimation___0001
+{
+  UI_ANIMATION_UPDATE_NO_CHANGE = (int) 0xc00,
+  UI_ANIMATION_UPDATE_VARIABLES_CHANGED = (int) 0xc01
+};
+enum __MIDL___MIDL_itf_UIAnimation___0002
+{
+  UI_ANIMATION_MANAGER_IDLE = (int) 0xc00,
+  UI_ANIMATION_MANAGER_BUSY = (int) 0xc01
+};
+enum __MIDL___MIDL_itf_UIAnimation___0003
+{
+  UI_ANIMATION_MODE_DISABLED = (int) 0xc00,
+  UI_ANIMATION_MODE_SYSTEM_DEFAULT = (int) 0xc01,
+  UI_ANIMATION_MODE_ENABLED = (int) 0xc02
+};
+enum __MIDL___MIDL_itf_UIAnimation__0008_0001
+{
+  UI_ANIMATION_PRIORITY_EFFECT_FAILURE = (int) 0xc00,
+  UI_ANIMATION_PRIORITY_EFFECT_DELAY = (int) 0xc01
+};
+enum __MIDL___MIDL_itf_UIAnimation___0004
+{
+  UI_ANIMATION_REPEAT_MODE_NORMAL = (int) 0xc00,
+  UI_ANIMATION_REPEAT_MODE_ALTERNATE = (int) 0xc01
+};
+enum __MIDL___MIDL_itf_UIAnimation__0009_0001
+{
+  UI_ANIMATION_SLOPE_INCREASING = (int) 0xc00,
+  UI_ANIMATION_SLOPE_DECREASING = (int) 0xc01
+};
+enum __MIDL___MIDL_itf_UIAnimation__0010_0001
+{
+  UI_ANIMATION_DEPENDENCY_NONE = (int) 0xc00,
+  UI_ANIMATION_DEPENDENCY_INTERMEDIATE_VALUES = (int) 0xc01,
+  UI_ANIMATION_DEPENDENCY_FINAL_VALUE =

[Mingw-w64-public] [PATCH 0/2] Add 'Windows Animation Manager' classes/interfaces

2017-07-13 Thread Ruslan Garipov


This is a series of commits that introduces [Windows Animation Manager]
[1] (WAM) support into MinGW-w64. WAM is a COM based framework, and I
created IDL and header files from scratch, since I did not find the
files in Wine.

I created 'uianimation.idl' file with 'genidl' tool from
'UIAnimation.dll' library from Microsoft Windows 10 SKU. The result IDL
file was then slightly modified (I replaced some keywords in a way
'widl' would "understand" the file and remove some typedefs that may
cause compilation errors). Then I generated 'uianimation.h' with 'widl'
compiler from the updated 'uianimation.idl'. The result header
'uianimation.h' was not modified after that.

I have tried to send those changes as one commit, but I ended up with
patch size limitation on mingw-w64 `public' mailing list. I couldn't
send the signle-commit-patch since e-mail with that patch slightly
exceeded 512 KB. As it was advised on mingw-w64 IRC chat, I split the
patch on to two parts.

There are some whitespace errors in the patch, but they appear because
such errors exist in the original Makefiles. I just "repeated" them.

Please review.

[1]:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd371981(v=vs.85).aspx
"Windows Animation Manager"

Ruslan Garipov (2):
 Add 'Windows Animation Manager' header file
 Add 'Windows Animation Manager' IDL file

mingw-w64-crt/Makefile.am |   18 +-
mingw-w64-crt/Makefile.in |   56 +-
mingw-w64-crt/libsrc/uianimation-uuid.c   |   44 +
mingw-w64-headers/Makefile.am |1 +
mingw-w64-headers/Makefile.in |1 +
mingw-w64-headers/include/uianimation.h   | 7325 +
mingw-w64-headers/include/uianimation.idl | 1291 +
7 files changed, 8718 insertions(+), 18 deletions(-)
create mode 100644 mingw-w64-crt/libsrc/uianimation-uuid.c
create mode 100644 mingw-w64-headers/include/uianimation.h
create mode 100644 mingw-w64-headers/include/uianimation.idl




--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] comctl32.def: Add `LoadIconMetric`

2017-02-24 Thread Ruslan Garipov
This is the patch generated by `git-format-patch(1)`.

Okay to apply to branch 'master'?

On 25.02.2017 4:54, JonY wrote:
> On 02/24/2017 02:15 PM, Ruslan Garipov wrote:
>> According to [MSDN] [1] 'comctl32.dll' exports function
>> `LoadIconMetric`, which is currently declared in mingw-w64's
>> 'commctrl.h', but is missed in exporting declarations. This patch fixes
>> that.
>>
>> Please review.
>>
> 
> Please use format-patch or send-email to generate/send patches so that
> the patch includes the commit log. Remember to sign off the patch.
> 
> 
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> 
> 
> 
> ___
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
> 

-- 
Yours truly,
Ruslan Garipov .
>From 723bef4de85bc777a9391ce9acc42ebb25d5fc62 Mon Sep 17 00:00:00 2001
From: Ruslan Garipov <ruslanngari...@gmail.com>
Date: Sat, 25 Feb 2017 11:25:33 +0500
Subject: [PATCH] comctl32.def: Add `LoadIconMetric`

According to [MSDN] [1] 'comctl32.dll' exports function
`LoadIconMetric`, which is currently declared in mingw-w64's
'commctrl.h', but is missed in exporting declarations. This patch fixes
that.

[1]:
https://msdn.microsoft.com/en-us/library/windows/desktop/bb775701(v=vs.85).aspx
"LoadIconMetric function"

Signed-off-by: Ruslan Garipov <ruslanngari...@gmail.com>
---
 mingw-w64-crt/lib32/comctl32.def | 1 +
 mingw-w64-crt/lib64/comctl32.def | 1 +
 2 files changed, 2 insertions(+)

diff --git a/mingw-w64-crt/lib32/comctl32.def b/mingw-w64-crt/lib32/comctl32.def
index 5456a3b9..c7b8d6ff 100644
--- a/mingw-w64-crt/lib32/comctl32.def
+++ b/mingw-w64-crt/lib32/comctl32.def
@@ -99,6 +99,7 @@ InitCommonControls@0
 InitCommonControlsEx@4
 InitMUILanguage@4
 LBItemFromPt@16
+LoadIconMetric@16
 MakeDragList@4
 MenuHelp@28
 PropertySheet@4
diff --git a/mingw-w64-crt/lib64/comctl32.def b/mingw-w64-crt/lib64/comctl32.def
index 71991330..207caa68 100644
--- a/mingw-w64-crt/lib64/comctl32.def
+++ b/mingw-w64-crt/lib64/comctl32.def
@@ -84,6 +84,7 @@ ImageList_Write
 InitCommonControlsEx
 InitMUILanguage
 InitializeFlatSB
+LoadIconMetric
 PropertySheet
 PropertySheetA
 PropertySheetW
-- 
2.11.1

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] comctl32.def: Add `LoadIconMetric`

2017-02-24 Thread Ruslan Garipov
According to [MSDN] [1] 'comctl32.dll' exports function
`LoadIconMetric`, which is currently declared in mingw-w64's
'commctrl.h', but is missed in exporting declarations. This patch fixes
that.

Please review.

---
 mingw-w64-crt/lib32/comctl32.def | 1 +
 mingw-w64-crt/lib64/comctl32.def | 1 +
 2 files changed, 2 insertions(+)

[1]:
https://msdn.microsoft.com/en-us/library/windows/desktop/bb775701(v=vs.85).aspx
"LoadIconMetric function"
diff --git a/mingw-w64-crt/lib32/comctl32.def b/mingw-w64-crt/lib32/comctl32.def
index 5456a3b9..c7b8d6ff 100644
--- a/mingw-w64-crt/lib32/comctl32.def
+++ b/mingw-w64-crt/lib32/comctl32.def
@@ -99,6 +99,7 @@ InitCommonControls@0
 InitCommonControlsEx@4
 InitMUILanguage@4
 LBItemFromPt@16
+LoadIconMetric@16
 MakeDragList@4
 MenuHelp@28
 PropertySheet@4
diff --git a/mingw-w64-crt/lib64/comctl32.def b/mingw-w64-crt/lib64/comctl32.def
index 71991330..207caa68 100644
--- a/mingw-w64-crt/lib64/comctl32.def
+++ b/mingw-w64-crt/lib64/comctl32.def
@@ -84,6 +84,7 @@ ImageList_Write
 InitCommonControlsEx
 InitMUILanguage
 InitializeFlatSB
+LoadIconMetric
 PropertySheet
 PropertySheetA
 PropertySheetW
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] user32.def: Add `ChangeWindowMessageFilterEx` and `ChangeWindowMessageFilter`

2017-02-20 Thread Ruslan Garipov
File 'mingw-w64-crt/lib32/user32.def' contains export declarations for
functions `ChangeWindowMessageFilterEx` and `ChangeWindowMessageFilter`.
While file
'mingw-w64-crt/lib64/user32.def' does not.

Please review.

---
 mingw-w64-crt/lib64/user32.def | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/mingw-w64-crt/lib64/user32.def b/mingw-w64-crt/lib64/user32.def
index d66e4d2f..76349885 100644
--- a/mingw-w64-crt/lib64/user32.def
+++ b/mingw-w64-crt/lib64/user32.def
@@ -44,6 +44,8 @@ ChangeDisplaySettingsExW
 ChangeDisplaySettingsW
 ChangeMenuA
 ChangeMenuW
+ChangeWindowMessageFilter
+ChangeWindowMessageFilterEx
 CharLowerA
 CharLowerBuffA
 CharLowerBuffW
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] Why is `ChangeWindowMessageFilterEx` defined in lib32, but not lib64?

2017-02-19 Thread Ruslan Garipov
Hello!

File 'mingw-w64-v5.0.1/mingw-w64-crt/lib32/user32.def' has exporting
declaration of function [ChangeWindowMessageFilterEx][1], but file
'mingw-w64-v5.0.1/mingw-w64-crt/lib64/user32.def' **does not**. Why?

Now, having MINGW targeting `x86_64-w64-mingw32' I can't built a program
that uses `ChangeWindowMessageFilterEx`.

Thanks!

[1]:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd388202(v=vs.85).aspx
"ChangeWindowMessageFilterEx function"

-- 
Yours truly,
Ruslan Garipov .

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] ID2D1Multithread interface

2016-12-19 Thread Ruslan Garipov
Do maintainers of MINGW have any plans to
include `ID2D1Multithread` to the project?

Here is documentation for `ID2D1Multithread` interface:
https://msdn.microsoft.com/en-us/library/windows/desktop/hh997713(v=vs.85).aspx

Thanks.



--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public