--- mingw-w64-crt/Makefile.am | 6 +- mingw-w64-crt/lib32/runtimeobject.def | 25 +++++ mingw-w64-crt/lib64/runtimeobject.def | 29 +++++ mingw-w64-headers/include/winstring.h | 202 ++++++++++++++++++++++++++++++++++ 4 files changed, 260 insertions(+), 2 deletions(-) create mode 100644 mingw-w64-crt/lib32/runtimeobject.def create mode 100644 mingw-w64-crt/lib64/runtimeobject.def create mode 100644 mingw-w64-headers/include/winstring.h
diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am index 4ce1258..71c9f15 100644 --- a/mingw-w64-crt/Makefile.am +++ b/mingw-w64-crt/Makefile.am @@ -542,7 +542,8 @@ lib32_DATA = \ lib32/libxapofx.a lib32/libx3daudio.a lib32/libd3dx9.a \ lib32/libd3dx10.a lib32/libd3dx11.a lib32/libd3dcsxd.a \ lib32/libd3dcompiler.a lib32/libwinhttp.a lib32/libmsvcr110.a \ - lib32/libdevmgr.a lib32/libdevobj.a lib32/libdevrtl.a + lib32/libdevmgr.a lib32/libdevobj.a lib32/libdevrtl.a \ + lib32/libruntimeobject.a if ! W32API lib32_DATA += lib32/libglut.a @@ -1043,7 +1044,8 @@ lib64_DATA = \ lib64/libxinput.a lib64/libxaudio.a lib64/libxaudiod.a \ lib64/libxapofx.a lib64/libx3daudio.a lib64/libd3dx9.a \ lib64/libd3dx10.a lib64/libd3dx11.a lib64/libd3dcsxd.a \ - lib64/libd3dcompiler.a lib64/libwinhttp.a lib64/libmsvcr110.a + lib64/libd3dcompiler.a lib64/libwinhttp.a lib64/libmsvcr110.a \ + lib64/libruntimeobject.a lib64/libcrtdll.a lib64/libmsvcrt.a lib64/libmsvcr80.a: lib64/lib%.a: lib64/%.def $(DTDEF64) $< --dllname $*.dll diff --git a/mingw-w64-crt/lib32/runtimeobject.def b/mingw-w64-crt/lib32/runtimeobject.def new file mode 100644 index 0000000..c49fc51 --- /dev/null +++ b/mingw-w64-crt/lib32/runtimeobject.def @@ -0,0 +1,25 @@ +LIBRARY "api-ms-win-core-winrt-string-l1-1-0.dll" +EXPORTS +HSTRING_UserFree@8 +HSTRING_UserMarshal@12 +HSTRING_UserSize@12 +HSTRING_UserUnmarshal@12 +WindowsCompareStringOrdinal@12 +WindowsConcatString@12 +WindowsCreateString@12 +WindowsCreateStringReference@16 +WindowsDeleteString@4 +WindowsDeleteStringBuffer@4 +WindowsDuplicateString@8 +WindowsGetStringLen@4 +WindowsGetStringRawBuffer@8 +WindowsInspectString@24 +WindowsIsStringEmpty@4 +WindowsPreallocateStringBuffer@12 +WindowsPromoteStringBuffer@8 +WindowsReplaceString@16 +WindowsStringHasEmbeddedNull@8 +WindowsSubstring@12 +WindowsSubstringWithSpecifiedLength@16 +WindowsTrimStringEnd@12 +WindowsTrimStringStart@12 diff --git a/mingw-w64-crt/lib64/runtimeobject.def b/mingw-w64-crt/lib64/runtimeobject.def new file mode 100644 index 0000000..c211978 --- /dev/null +++ b/mingw-w64-crt/lib64/runtimeobject.def @@ -0,0 +1,29 @@ +LIBRARY "api-ms-win-core-winrt-string-l1-1-0.dll" +EXPORTS +HSTRING_UserFree +HSTRING_UserFree64 +HSTRING_UserMarshal +HSTRING_UserMarshal64 +HSTRING_UserSize +HSTRING_UserSize64 +HSTRING_UserUnmarshal +HSTRING_UserUnmarshal64 +WindowsCompareStringOrdinal +WindowsConcatString +WindowsCreateString +WindowsCreateStringReference +WindowsDeleteString +WindowsDeleteStringBuffer +WindowsDuplicateString +WindowsGetStringLen +WindowsGetStringRawBuffer +WindowsInspectString +WindowsIsStringEmpty +WindowsPreallocateStringBuffer +WindowsPromoteStringBuffer +WindowsReplaceString +WindowsStringHasEmbeddedNull +WindowsSubstring +WindowsSubstringWithSpecifiedLength +WindowsTrimStringEnd +WindowsTrimStringStart diff --git a/mingw-w64-headers/include/winstring.h b/mingw-w64-headers/include/winstring.h new file mode 100644 index 0000000..b395cef --- /dev/null +++ b/mingw-w64-headers/include/winstring.h @@ -0,0 +1,202 @@ +/** + * 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 __WINSTRING_H__ +#define __WINSTRING_H__ + +#include <windows.h> +#include <sdkddkver.h> + +#if _WIN32_WINNT >= _WIN32_WINNT_WIN8 + +// Declaring a handle dummy struct for HSTRING the same way DECLARE_HANDLE does. +typedef struct HSTRING__{ + int unused; +} HSTRING__; + +typedef HSTRING__* HSTRING; + +typedef HANDLE HSTRING_BUFFER; + +typedef struct HSTRING_HEADER { + union { + PVOID Reserved1; +#if (_WIN64) + char Reserved2[24]; +#else + char Reserved2[20]; +#endif + } Reserved; +} HSTRING_HEADER; + +/* */ + +void __stdcall HSTRING_UserFree( + unsigned long *pFlags, + HSTRING *ppidl +); + +unsigned char* __stdcall HSTRING_UserMarshal( + unsigned long *pFlags, + unsigned char *pBuffer, + HSTRING *ppidl +); + +unsigned long __stdcall HSTRING_UserSize( + unsigned long *pFlags, + unsigned long StartingSize, + HSTRING *ppidl +); + +unsigned char* __stdcall HSTRING_UserUnmarshal( + unsigned long *pFlags, + unsigned char *pBuffer, + HSTRING *ppidl +); + +#ifdef _WIN64 +void __stdcall HSTRING_UserFree64( + unsigned long *pFlags, + HSTRING *ppidl +); + +unsigned char* __stdcall HSTRING_UserMarshal64( + unsigned long *pFlags, + unsigned char *pBuffer, + HSTRING *ppidl +); + +unsigned long __stdcall HSTRING_UserSize64( + unsigned long *pFlags, + unsigned long StartingSize, + HSTRING *ppidl +); + +unsigned char* __stdcall HSTRING_UserUnmarshal64( + unsigned long *pFlags, + unsigned char *pBuffer, + HSTRING *ppidl +); +#endif + +/* */ + +HRESULT WINAPI WindowsCompareStringOrdinal( + HSTRING string1, + HSTRING string2, + INT32 *result +); + +HRESULT WINAPI WindowsConcatString( + HSTRING string1, + HSTRING string2, + HSTRING *newString +); + +HRESULT WINAPI WindowsCreateString( + LPCWSTR sourceString, + UINT32 length, + HSTRING *string +); + +HRESULT WINAPI WindowsCreateStringReference( + PCWSTR sourceString, + UINT32 length, + HSTRING_HEADER *hstringHeader, + HSTRING *string +); + +HRESULT WINAPI WindowsDeleteString( + HSTRING string +); + +HRESULT WindowsDeleteStringBuffer( + HSTRING_BUFFER bufferHandle +); + +HRESULT WINAPI WindowsDuplicateString( + HSTRING string, + HSTRING *newString +); + +UINT32 WINAPI WindowsGetStringLen( + HSTRING string +); + +PCWSTR WINAPI WindowsGetStringRawBuffer( + HSTRING string, + UINT32 *length +); + +typedef HRESULT ( WINAPI *PINSPECT_HSTRING_CALLBACK)( + void *context, + UINT_PTR readAddress, + UINT32 length, + BYTE *buffer +); + +HRESULT WINAPI WindowsInspectString( + UINT_PTR targetHString, + USHORT machine, + PINSPECT_HSTRING_CALLBACK callback, + void *context, + UINT32 *length, + UINT_PTR *targetStringAddress +); + +BOOL WINAPI WindowsIsStringEmpty( + HSTRING string +); + +HRESULT WindowsPreallocateStringBuffer( + UINT32 length, + WCHAR **mutableBuffer, + HSTRING_BUFFER *bufferHandle +); + +HRESULT WindowsPromoteStringBuffer( + HSTRING_BUFFER bufferHandle, + HSTRING *string +); + +HRESULT WINAPI WindowsReplaceString( + HSTRING string, + HSTRING stringReplaced, + HSTRING stringReplaceWith, + HSTRING *newString +); + +HRESULT WINAPI WindowsStringHasEmbeddedNull( + HSTRING string, + BOOL *hasEmbedNull +); + +HRESULT WINAPI WindowsSubstring( + HSTRING string, + UINT32 startIndex, + HSTRING *newString +); + +HRESULT WINAPI WindowsSubstringWithSpecifiedLength( + HSTRING string, + UINT32 startIndex, + UINT32 length, + HSTRING *newString +); + +HRESULT WINAPI WindowsTrimStringEnd( + HSTRING string, + HSTRING trimString, + HSTRING *newString +); + +HRESULT WINAPI WindowsTrimStringStart( + HSTRING string, + HSTRING trimString, + HSTRING *newString +); + +#endif +#endif -- 1.8.1.2 ------------------------------------------------------------------------------ Get 100% visibility into Java/.NET code with AppDynamics Lite It's a free troubleshooting tool designed for production Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap2 _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public