Add winstring.h, hstring.idl and corresponding runtimeobject imports
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@5879 4407c894-4637-0410-b4f5-ada5f102cad1
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/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/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/Makefile.am b/mingw-w64-headers/Makefile.am
index b66f87e..fa1847f 100644
--- a/mingw-w64-headers/Makefile.am
+++ b/mingw-w64-headers/Makefile.am
@@ -68,6 +68,7 @@
include/endpointvolume.idl \
include/fusion.idl \
include/fwptypes.idl \
+ include/hstring.idl \
include/iketypes.idl \
include/inputscope.idl \
include/oaidl.idl \
diff --git a/mingw-w64-headers/Makefile.in b/mingw-w64-headers/Makefile.in
index 66aa017..77b73cb 100644
--- a/mingw-w64-headers/Makefile.in
+++ b/mingw-w64-headers/Makefile.in
@@ -292,6 +292,7 @@
@HAVE_WIDL_TRUE@ include/endpointvolume.idl \
@HAVE_WIDL_TRUE@ include/fusion.idl \
@HAVE_WIDL_TRUE@ include/fwptypes.idl \
+@HAVE_WIDL_TRUE@ include/hstring.idl \
@HAVE_WIDL_TRUE@ include/iketypes.idl \
@HAVE_WIDL_TRUE@ include/inputscope.idl \
@HAVE_WIDL_TRUE@ include/oaidl.idl \
diff --git a/mingw-w64-headers/include/hstring.h b/mingw-w64-headers/include/hstring.h
new file mode 100644
index 0000000..1fd211e
--- /dev/null
+++ b/mingw-w64-headers/include/hstring.h
@@ -0,0 +1,54 @@
+/*** Autogenerated by WIDL 1.5.19 from include/hstring.idl - Do not edit ***/
+
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
+#endif
+
+#include <rpc.h>
+#include <rpcndr.h>
+
+#ifndef COM_NO_WINDOWS_H
+#include <windows.h>
+#include <ole2.h>
+#endif
+
+#ifndef __hstring_h__
+#define __hstring_h__
+
+/* Forward declarations */
+
+/* Headers for imported files */
+
+#include <wtypes.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct HSTRING__ {
+ int unused;
+} HSTRING__;
+typedef HSTRING__ *HSTRING;
+
+ typedef struct HSTRING_HEADER {
+ __C89_NAMELESS union {
+ PVOID Reserved1;
+#ifdef _WIN64
+ char Reserved2[24];
+#else
+ char Reserved2[20];
+#endif
+ } Reserved;
+ } HSTRING_HEADER;
+
+DECLARE_HANDLE(HSTRING_BUFFER);
+/* Begin additional prototypes for all interfaces */
+
+
+/* End additional prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __hstring_h__ */
diff --git a/mingw-w64-headers/include/hstring.idl b/mingw-w64-headers/include/hstring.idl
new file mode 100644
index 0000000..4f6d370
--- /dev/null
+++ b/mingw-w64-headers/include/hstring.idl
@@ -0,0 +1,20 @@
+import "wtypes.idl";
+
+typedef struct HSTRING__{
+ int unused;
+} HSTRING__;
+typedef [wire_marshal(wireBSTR), unique] HSTRING__ *HSTRING;
+
+cpp_quote("")
+cpp_quote(" typedef struct HSTRING_HEADER {")
+cpp_quote(" __C89_NAMELESS union {")
+cpp_quote(" PVOID Reserved1;")
+cpp_quote("#ifdef _WIN64")
+cpp_quote(" char Reserved2[24];")
+cpp_quote("#else")
+cpp_quote(" char Reserved2[20];")
+cpp_quote("#endif")
+cpp_quote(" } Reserved;")
+cpp_quote(" } HSTRING_HEADER;")
+cpp_quote("")
+cpp_quote("DECLARE_HANDLE(HSTRING_BUFFER);")
diff --git a/mingw-w64-headers/include/winstring.h b/mingw-w64-headers/include/winstring.h
new file mode 100644
index 0000000..c37097c
--- /dev/null
+++ b/mingw-w64-headers/include/winstring.h
@@ -0,0 +1,77 @@
+/**
+ * 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>
+#include <rpc.h>
+#include <hstring.h>
+
+#if _WIN32_WINNT >= _WIN32_WINNT_WIN8
+
+void __RPC_USER HSTRING_UserFree(unsigned long *pFlags, HSTRING *ppidl);
+
+unsigned char* __RPC_USER HSTRING_UserMarshal(unsigned long *pFlags, unsigned char *pBuffer, HSTRING *ppidl);
+
+unsigned long __RPC_USER HSTRING_UserSize(unsigned long *pFlags, unsigned long StartingSize, HSTRING *ppidl);
+
+unsigned char* __RPC_USER HSTRING_UserUnmarshal(unsigned long *pFlags, unsigned char *pBuffer, HSTRING *ppidl);
+
+#ifdef _WIN64
+void __RPC_USER HSTRING_UserFree64(unsigned long *pFlags, HSTRING *ppidl);
+
+unsigned char* __RPC_USER HSTRING_UserMarshal64(unsigned long *pFlags, unsigned char *pBuffer, HSTRING *ppidl);
+
+unsigned long __RPC_USER HSTRING_UserSize64(unsigned long *pFlags, unsigned long StartingSize, HSTRING *ppidl);
+
+unsigned char* __RPC_USER 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