VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPRegistry.cpp@ 85817

Last change on this file since 85817 was 82968, checked in by vboxsync, 5 years ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 KB
Line 
1/* $Id: VBoxMPRegistry.cpp 82968 2020-02-04 10:35:17Z vboxsync $ */
2/** @file
3 * VBox WDDM Miniport registry related functions
4 */
5
6/*
7 * Copyright (C) 2011-2020 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#include "common/VBoxMPCommon.h"
19
20VP_STATUS VBoxMPCmnRegInit(IN PVBOXMP_DEVEXT pExt, OUT VBOXMPCMNREGISTRY *pReg)
21{
22 WCHAR Buf[512];
23 ULONG cbBuf = sizeof(Buf);
24 NTSTATUS Status = vboxWddmRegQueryDrvKeyName(pExt, cbBuf, Buf, &cbBuf);
25 AssertNtStatusSuccess(Status);
26 if (Status == STATUS_SUCCESS)
27 {
28 Status = vboxWddmRegOpenKey(pReg, Buf, GENERIC_READ | GENERIC_WRITE);
29 AssertNtStatusSuccess(Status);
30 if(Status == STATUS_SUCCESS)
31 return NO_ERROR;
32 }
33
34 /* fall-back to make the subsequent VBoxVideoCmnRegXxx calls treat the fail accordingly
35 * basically needed to make as less modifications to the current XPDM code as possible */
36 *pReg = NULL;
37
38 return ERROR_INVALID_PARAMETER;
39}
40
41VP_STATUS VBoxMPCmnRegFini(IN VBOXMPCMNREGISTRY Reg)
42{
43 if (!Reg)
44 {
45 return ERROR_INVALID_PARAMETER;
46 }
47
48 NTSTATUS Status = ZwClose(Reg);
49 return Status == STATUS_SUCCESS ? NO_ERROR : ERROR_INVALID_PARAMETER;
50}
51
52VP_STATUS VBoxMPCmnRegQueryDword(IN VBOXMPCMNREGISTRY Reg, PWSTR pName, uint32_t *pVal)
53{
54 /* seems like the new code assumes the Reg functions zeroes up the value on failure */
55 *pVal = 0;
56
57 if (!Reg)
58 {
59 return ERROR_INVALID_PARAMETER;
60 }
61
62 NTSTATUS Status = vboxWddmRegQueryValueDword(Reg, pName, (PDWORD)pVal);
63 return Status == STATUS_SUCCESS ? NO_ERROR : ERROR_INVALID_PARAMETER;
64}
65
66VP_STATUS VBoxMPCmnRegSetDword(IN VBOXMPCMNREGISTRY Reg, PWSTR pName, uint32_t Val)
67{
68 if (!Reg)
69 {
70 return ERROR_INVALID_PARAMETER;
71 }
72
73 NTSTATUS Status = vboxWddmRegSetValueDword(Reg, pName, Val);
74 return Status == STATUS_SUCCESS ? NO_ERROR : ERROR_INVALID_PARAMETER;
75}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette