|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 15/18] xenvbd: Accept NULL in RegistryOpenKey, RegistryCreateKey and __RingFree
A NULL Parent is how RegistryOpenKey and RegistryCreateKey open a key by
its full path, and __RingFree already returns early on a NULL buffer
(BlkifRingCreate relies on this after it moves Path to the ring).
Annotate these parameters _In_opt_ instead of _In_.
No functional change.
Signed-off-by: Césaire Mounah <cesaire.mounah@xxxxxxxxxx>
---
src/xenvbd/registry.c | 4 ++--
src/xenvbd/registry.h | 4 ++--
src/xenvbd/ring.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/xenvbd/registry.c b/src/xenvbd/registry.c
index d949460..a11d562 100644
--- a/src/xenvbd/registry.c
+++ b/src/xenvbd/registry.c
@@ -113,7 +113,7 @@ RegistryTeardown(
_IRQL_requires_(PASSIVE_LEVEL)
NTSTATUS
RegistryOpenKey(
- _In_ HANDLE Parent,
+ _In_opt_ HANDLE Parent,
_In_ PUNICODE_STRING Path,
_In_ ACCESS_MASK DesiredAccess,
_Out_ PHANDLE Key
@@ -177,7 +177,7 @@ fail1:
_IRQL_requires_(PASSIVE_LEVEL)
NTSTATUS
RegistryCreateKey(
- _In_ HANDLE Root,
+ _In_opt_ HANDLE Root,
_In_ PUNICODE_STRING Path,
_In_ ULONG Options,
_Out_ PHANDLE Key
diff --git a/src/xenvbd/registry.h b/src/xenvbd/registry.h
index 557ab2c..654c919 100644
--- a/src/xenvbd/registry.h
+++ b/src/xenvbd/registry.h
@@ -49,7 +49,7 @@ RegistryTeardown(
_IRQL_requires_(PASSIVE_LEVEL)
extern NTSTATUS
RegistryOpenKey(
- _In_ HANDLE Parent,
+ _In_opt_ HANDLE Parent,
_In_ PUNICODE_STRING Path,
_In_ ACCESS_MASK DesiredAccess,
_Out_ PHANDLE Key
@@ -58,7 +58,7 @@ RegistryOpenKey(
_IRQL_requires_(PASSIVE_LEVEL)
extern NTSTATUS
RegistryCreateKey(
- _In_ HANDLE Parent,
+ _In_opt_ HANDLE Parent,
_In_ PUNICODE_STRING Path,
_In_ ULONG Options,
_Out_ PHANDLE Key
diff --git a/src/xenvbd/ring.c b/src/xenvbd/ring.c
index 31c8b65..339679b 100644
--- a/src/xenvbd/ring.c
+++ b/src/xenvbd/ring.c
@@ -140,7 +140,7 @@ __RingAllocate(
static FORCEINLINE VOID
__RingFree(
- _In_ PVOID Buffer
+ _In_opt_ PVOID Buffer
)
{
if (Buffer)
--
2.55.0.windows.5
--
Césaire Mounah | Vates Windows Guest Tools Engineer
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |