1 | /* $Id: VBoxMPRegistry.cpp 76553 2019-01-01 01:45:53Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox XPDM Miniport registry related functions
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2011-2019 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 |
|
---|
20 | static VP_STATUS
|
---|
21 | VBoxMPQueryNamedValueCB(PVOID HwDeviceExtension, PVOID Context, PWSTR ValueName, PVOID ValueData, ULONG ValueLength)
|
---|
22 | {
|
---|
23 | RT_NOREF(HwDeviceExtension, ValueName);
|
---|
24 | PAGED_CODE();
|
---|
25 |
|
---|
26 | if (!ValueLength || !Context)
|
---|
27 | {
|
---|
28 | WARN(("failed due to invalid parameters"));
|
---|
29 | return ERROR_INVALID_PARAMETER;
|
---|
30 | }
|
---|
31 |
|
---|
32 | *(uint32_t *)Context = *(uint32_t *)ValueData;
|
---|
33 |
|
---|
34 | return NO_ERROR;
|
---|
35 | }
|
---|
36 |
|
---|
37 |
|
---|
38 | VP_STATUS VBoxMPCmnRegInit(IN PVBOXMP_DEVEXT pExt, OUT VBOXMPCMNREGISTRY *pReg)
|
---|
39 | {
|
---|
40 | *pReg = pExt->pPrimary;
|
---|
41 | return NO_ERROR;
|
---|
42 | }
|
---|
43 |
|
---|
44 | VP_STATUS VBoxMPCmnRegFini(IN VBOXMPCMNREGISTRY Reg)
|
---|
45 | {
|
---|
46 | RT_NOREF(Reg);
|
---|
47 | return NO_ERROR;
|
---|
48 | }
|
---|
49 |
|
---|
50 | VP_STATUS VBoxMPCmnRegSetDword(IN VBOXMPCMNREGISTRY Reg, PWSTR pName, uint32_t Val)
|
---|
51 | {
|
---|
52 | return VideoPortSetRegistryParameters(Reg, pName, &Val, sizeof(Val));
|
---|
53 | }
|
---|
54 |
|
---|
55 | VP_STATUS VBoxMPCmnRegQueryDword(IN VBOXMPCMNREGISTRY Reg, PWSTR pName, uint32_t *pVal)
|
---|
56 | {
|
---|
57 | VP_STATUS rc;
|
---|
58 |
|
---|
59 | rc = VideoPortGetRegistryParameters(Reg, pName, FALSE, VBoxMPQueryNamedValueCB, pVal);
|
---|
60 | if (rc!=NO_ERROR && pVal)
|
---|
61 | {
|
---|
62 | *pVal = 0;
|
---|
63 | }
|
---|
64 | return rc;
|
---|
65 | }
|
---|