[PATCH 1/2] slc: Implement SLGetWindowsInformationDWORD [try 2]
Detlef Riekenberg
wine.dev at web.de
Fri Nov 5 09:22:48 CDT 2010
This let a vista games go a bit further
try 2 does some checks of the name-value pair and only
return S_OK with a value of 1 for the games
Informations found here:
http://www.withinwindows.com/2008/10/03/short-slgetwindowsinformationdword-value-names/
--
By by ... Detlef
---
dlls/slc/slc.c | 51 ++++++++++++++++++++++++++++++++++++++++++++-------
include/slerror.h | 1 +
include/slpublic.h | 2 +-
3 files changed, 46 insertions(+), 8 deletions(-)
diff --git a/dlls/slc/slc.c b/dlls/slc/slc.c
index e7416f1..72efaeb 100644
--- a/dlls/slc/slc.c
+++ b/dlls/slc/slc.c
@@ -1,6 +1,7 @@
/*
*
* Copyright 2008 Alistair Leslie-Hughes
+ * Copyright 2010 Detlef Riekenberg
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -22,21 +23,17 @@
#include "windef.h"
#include "winbase.h"
#include "wine/debug.h"
+#include "wine/unicode.h"
#include "slpublic.h"
#include "slerror.h"
WINE_DEFAULT_DEBUG_CHANNEL(slc);
-DWORD WINAPI SLGetWindowsInformationDWORD(LPCWSTR lpszValueName, LPDWORD pdwValue)
-{
- FIXME("(%s) stub\n", debugstr_w(lpszValueName) );
-
- return SL_E_RIGHT_NOT_GRANTED;
-}
+static const WCHAR enable_game[] = {'E','n','a','b','l','e','G','a','m','e',0};
/***********************************************************************
- * DllMain (CLUSAPI.@)
+ * DllMain (slc.@)
*
*/
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
@@ -51,3 +48,43 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
}
return TRUE;
}
+
+/***********************************************************************
+ * SLGetWindowsInformationDWORD (slc.@)
+ *
+ * check the license and return the value for the given name
+ *
+ * PARAMS
+ * lpszValueName [i] application related value name to check
+ * pdwValue [o] ptr, where the value for the given name should be saved
+ *
+ * RETURNS
+ * Success: S_OK
+ * Failure: A HRESULT error code
+ *
+ */
+HRESULT WINAPI SLGetWindowsInformationDWORD(LPCWSTR lpszValueName, LPDWORD pdwValue)
+{
+ LPWSTR last_part;
+
+ FIXME("(%s, %p): semi-stub\n", debugstr_w(lpszValueName), pdwValue);
+
+ if (!lpszValueName || !pdwValue)
+ return E_INVALIDARG;
+
+ last_part = strrchrW(lpszValueName, '-');
+
+ if (*lpszValueName && last_part) {
+ last_part++;
+ if (!lstrcmpW(last_part, enable_game)) {
+ /* enable games */
+ *pdwValue = 1;
+ return S_OK;
+ }
+ }
+ /* SL_E_VALUE_NOT_FOUND (0xC004F012) fit best as name here, but the value
+ 0xC004F013 (SL_E_RIGHT_NOT_GRANTED) is returned on Windows */
+
+ return SL_E_RIGHT_NOT_GRANTED;
+
+}
diff --git a/include/slerror.h b/include/slerror.h
index 9c800f6..8b45d99 100644
--- a/include/slerror.h
+++ b/include/slerror.h
@@ -19,6 +19,7 @@
#ifndef __WINE_SLERROR_H
#define __WINE_SLERROR_H
+#define SL_E_VALUE_NOT_FOUND 0xC004F012
#define SL_E_RIGHT_NOT_GRANTED 0xC004F013
#define SL_E_DATATYPE_MISMATCHED 0xC004F01E
diff --git a/include/slpublic.h b/include/slpublic.h
index a2c6d42..177acdb 100644
--- a/include/slpublic.h
+++ b/include/slpublic.h
@@ -29,7 +29,7 @@ extern "C" {
#define SLCAPI DECLSPEC_IMPORT
#endif
-SLCAPI DWORD WINAPI SLGetWindowsInformationDWORD(LPCWSTR lpszValueName, LPDWORD pdwValue);
+SLCAPI HRESULT WINAPI SLGetWindowsInformationDWORD(LPCWSTR, LPDWORD);
#ifdef __cplusplus
--
1.7.1
More information about the wine-patches
mailing list