2008-02-19 14:17:08 +01:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Copyright 2008 Alistair Leslie-Hughes
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
2014-12-22 20:27:07 +01:00
|
|
|
#include "ntstatus.h"
|
|
|
|
#define WIN32_NO_STATUS
|
2008-02-19 14:17:08 +01:00
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
2014-12-22 20:27:07 +01:00
|
|
|
#include "winternl.h"
|
2008-02-19 14:17:08 +01:00
|
|
|
#include "wine/debug.h"
|
|
|
|
|
2008-02-21 10:18:50 +01:00
|
|
|
#include "slpublic.h"
|
|
|
|
#include "slerror.h"
|
|
|
|
|
2008-02-19 14:17:08 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(slc);
|
|
|
|
|
2018-11-22 19:43:30 +01:00
|
|
|
HRESULT WINAPI SLGetLicensingStatusInformation(HSLC handle, const SLID *app, const SLID *product,
|
|
|
|
LPCWSTR name, UINT *count, SL_LICENSING_STATUS **status)
|
|
|
|
{
|
|
|
|
FIXME("(%p %p %p %s %p %p) stub\n", handle, app, product, debugstr_w(name), count, status );
|
|
|
|
|
|
|
|
return SL_E_RIGHT_NOT_CONSUMED;
|
|
|
|
}
|
|
|
|
|
2014-10-07 21:27:30 +02:00
|
|
|
HRESULT WINAPI SLGetWindowsInformation(LPCWSTR name, SLDATATYPE *type, UINT *val, LPBYTE *size)
|
|
|
|
{
|
|
|
|
FIXME("(%s %p %p %p) stub\n", debugstr_w(name), type, val, size );
|
|
|
|
|
|
|
|
return SL_E_RIGHT_NOT_GRANTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI SLGetWindowsInformationDWORD(LPCWSTR lpszValueName, LPDWORD pdwValue)
|
2008-02-21 10:18:50 +01:00
|
|
|
{
|
2014-12-22 20:27:07 +01:00
|
|
|
UNICODE_STRING nameW;
|
|
|
|
NTSTATUS status;
|
|
|
|
ULONG type, len;
|
2008-02-21 10:18:50 +01:00
|
|
|
|
2014-12-22 20:27:07 +01:00
|
|
|
TRACE("(%s)\n", debugstr_w(lpszValueName) );
|
|
|
|
|
|
|
|
if (!lpszValueName || !pdwValue)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
if (!lpszValueName[0])
|
|
|
|
return SL_E_RIGHT_NOT_GRANTED;
|
|
|
|
|
|
|
|
RtlInitUnicodeString( &nameW, lpszValueName );
|
|
|
|
status = NtQueryLicenseValue( &nameW, &type, pdwValue, sizeof(DWORD), &len );
|
|
|
|
|
|
|
|
if (status == STATUS_OBJECT_NAME_NOT_FOUND)
|
|
|
|
return SL_E_VALUE_NOT_FOUND;
|
|
|
|
if ((!status || status == STATUS_BUFFER_TOO_SMALL) && (type != REG_DWORD))
|
|
|
|
return SL_E_DATATYPE_MISMATCHED;
|
|
|
|
|
|
|
|
return status ? E_FAIL : S_OK;
|
2008-02-21 10:18:50 +01:00
|
|
|
}
|
2008-02-19 14:17:08 +01:00
|
|
|
|
2018-11-17 12:54:11 +01:00
|
|
|
HRESULT WINAPI SLOpen(HSLC *handle)
|
|
|
|
{
|
|
|
|
FIXME("(%p) stub\n", handle );
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|