#ifndef WIN8_METRO_DRIVER_WINRT_UTILS_H_
#define WIN8_METRO_DRIVER_WINRT_UTILS_H_
#include <string>
#include <roapi.h>
#include <windows.applicationmodel.core.h>
#include "base/strings/string16.h"
void CheckHR(HRESULT hr, const char* str = nullptr);
HSTRING MakeHString(const base::string16& str);
base::string16 MakeStdWString(HSTRING hstring);
namespace winrt_utils {
template<unsigned int size, typename T>
HRESULT CreateActivationFactory(wchar_t const (&class_name)[size], T** object) {
mswrw::HStringReference ref_class_name(class_name);
return winfoundtn::GetActivationFactory(ref_class_name.Get(), object);
}
#define DECLARE_CREATE_PROPERTY(Name, Type) \
HRESULT Create ## Name ## Property( \
Type value, \
winfoundtn::IPropertyValue** prop);
DECLARE_CREATE_PROPERTY(String, HSTRING);
DECLARE_CREATE_PROPERTY(Int16, INT16);
DECLARE_CREATE_PROPERTY(Int32, INT32);
DECLARE_CREATE_PROPERTY(Int64, INT64);
DECLARE_CREATE_PROPERTY(UInt8, UINT8);
DECLARE_CREATE_PROPERTY(UInt16, UINT16);
DECLARE_CREATE_PROPERTY(UInt32, UINT32);
DECLARE_CREATE_PROPERTY(UInt64, UINT64);
HRESULT CompareProperties(
winfoundtn::IPropertyValue* lhs, winfoundtn::IPropertyValue* rhs,
INT32* result);
base::string16 ReadArgumentsFromPinnedTaskbarShortcut();
}
#endif