Ok for apply?

Kai
From 21e83ae9fddf527b312268b348d3f67511c246e0 Mon Sep 17 00:00:00 2001
From: Kai Tietz <[email protected]>
Date: Mon, 25 Aug 2014 22:39:10 +0200
Subject: Add winapi-family check, correct interface IObtainRating for C, add
 wide-character variant of API.

---
 mingw-w64-headers/include/ratings.h |   30 ++++++++++++++++++++++++------
 1 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/mingw-w64-headers/include/ratings.h 
b/mingw-w64-headers/include/ratings.h
index 861589b..14e9b2f 100644
--- a/mingw-w64-headers/include/ratings.h
+++ b/mingw-w64-headers/include/ratings.h
@@ -1,35 +1,46 @@
 /**
- * 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.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
  */
 #ifndef _RATINGS_H_
 #define _RATINGS_H_
 
+#include <winapifamily.h>
+
+#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
+
 #include <winerror.h>
 #include <shlwapi.h>
 
 STDAPI RatingEnable(HWND hwndParent,LPCSTR pszUsername,WINBOOL fEnable);
+STDAPI RatingEnableW(HWND hwndParent, LPCWSTR pszUsername, WINBOOL fEnable);
 STDAPI RatingCheckUserAccess(LPCSTR pszUsername,LPCSTR pszURL,LPCSTR 
pszRatingInfo,LPBYTE pData,DWORD cbData,void **ppRatingDetails);
+STDAPI RatingCheckUserAccessW(LPCWSTR pszUsername, LPCWSTR pszURL, LPCWSTR 
pszRatingInfo, LPBYTE pData, DWORD cbData, void **ppRatingDetails);
 STDAPI RatingAccessDeniedDialog(HWND hDlg,LPCSTR pszUsername,LPCSTR 
pszContentDescription,void *pRatingDetails);
 STDAPI RatingAccessDeniedDialog2(HWND hDlg,LPCSTR pszUsername,void 
*pRatingDetails);
+STDAPI RatingAccessDeniedDialogW(HWND hDlg, LPCWSTR pszUsername, LPCWSTR 
pszContentDescription, void *pRatingDetails);
 STDAPI RatingFreeDetails(void *pRatingDetails);
 STDAPI RatingObtainCancel(HANDLE hRatingObtainQuery);
 STDAPI RatingObtainQuery(LPCSTR pszTargetUrl,DWORD dwUserData,void 
(*fCallback)(DWORD dwUserData,HRESULT hr,LPCSTR pszRating,void 
*lpvRatingDetails),HANDLE *phRatingObtainQuery);
+STDAPI RatingObtainQueryW(LPCWSTR pszTargetUrl, DWORD dwUserData, void 
(*fCallback) (DWORD dwUserData, HRESULT hr, LPCWSTR pszRating, void 
*lpvRatingDetails),HANDLE *phRatingObtainQuery);
 STDAPI RatingSetupUI(HWND hDlg,LPCSTR pszUsername);
+STDAPI RatingSetupUIW (HWND hDlg, LPCWSTR pszUsername);
 #ifdef _INC_COMMCTRL
 STDAPI RatingAddPropertyPage(PROPSHEETHEADER *ppsh);
 #endif
 
+STDAPI RatingAddToApprovedSites (HWND hDlg, DWORD cbPasswordBlob, BYTE 
*pbPasswordBlob, LPCWSTR lpszUrl, WINBOOL fAlwaysNever, WINBOOL fSitePage, 
WINBOOL fApprovedSitesEnforced);
+STDAPI RatingClickedOnPRFInternal (HWND hWndOwner, HINSTANCE, LPSTR 
lpszFileName, int nShow);
+STDAPI RatingClickedOnRATInternal (HWND hWndOwner, HINSTANCE, LPSTR 
lpszFileName, int nShow);
+
 STDAPI RatingEnabledQuery();
 STDAPI RatingInit();
 STDAPI_(void) RatingTerm();
 
 static inline WINBOOL IS_RATINGS_ENABLED() {
-  TCHAR szSup[200];
-  DWORD dwType;
-  DWORD cbSize = sizeof(szSup);
-  return 
(SHGetValue(HKEY_LOCAL_MACHINE,TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Ratings"),TEXT("Key"),&dwType,&szSup,&cbSize)==ERROR_SUCCESS);
+  TCHAR sz[200];
+  DWORD typ, sz = sizeof (sz);
+  return 
(SHGetValue(HKEY_LOCAL_MACHINE,TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Ratings"),TEXT("Key"),
 &typ,&sz, &sz) == ERROR_SUCCESS);
 }
 
 #define S_RATING_ALLOW S_OK
@@ -37,14 +48,21 @@ static inline WINBOOL IS_RATINGS_ENABLED() {
 #define S_RATING_FOUND 0x00000002
 #define E_RATING_NOT_FOUND 0x80000001
 
+#undef INTERFACE
+#define INTERFACE IObtainRating
 DECLARE_INTERFACE_(IObtainRating,IUnknown) {
+#ifndef __cplusplus
   STDMETHOD(QueryInterface) (THIS_ REFIID riid,void **ppvObj) PURE;
   STDMETHOD_(ULONG,AddRef) (THIS) PURE;
   STDMETHOD_(ULONG,Release) (THIS) PURE;
+#endif
   STDMETHOD(ObtainRating) (THIS_ LPCSTR pszTargetUrl,HANDLE 
hAbortEvent,IMalloc *pAllocator,LPSTR *ppRatingOut) PURE;
   STDMETHOD_(ULONG,GetSortOrder) (THIS) PURE;
 };
+#undef INTERFACE
 
 #define RATING_ORDER_REMOTESITE 0x80000000
 #define RATING_ORDER_LOCALLIST 0xC0000000
+
+#endif
 #endif
-- 
1.7.9

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to