|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 2/3] xenvbd: Sync common helper files with xenbus
Take assert.h and registry.c/h from xenbus.
Signed-off-by: Césaire Mounah <cesaire.mounah@xxxxxxxxxx>
---
src/xenvbd/assert.h | 19 +++++++++----------
src/xenvbd/registry.c | 24 ++++++++++++------------
src/xenvbd/registry.h | 16 ++++++++--------
3 files changed, 29 insertions(+), 30 deletions(-)
diff --git a/src/xenvbd/assert.h b/src/xenvbd/assert.h
index b1e206c..8c4315e 100644
--- a/src/xenvbd/assert.h
+++ b/src/xenvbd/assert.h
@@ -56,7 +56,6 @@ __Bug(
#define ASSERTION_FAILURE 0x0000DEAD
-
#define BUG(_TEXT) \
do { \
PCSTR _Text = (_TEXT); \
@@ -155,13 +154,13 @@ __Bug(
static __inline BOOLEAN
_IsZeroMemory(
- _In_ PCSTR Caller,
- _In_ PCSTR Name,
- _In_ PVOID Buffer,
- _In_ ULONG Length
+ _In_ PCSTR Caller,
+ _In_ PCSTR Name,
+ _In_reads_bytes_(Length) PVOID Buffer,
+ _In_ ULONG Length
)
{
- ULONG Offset;
+ ULONG Offset;
Offset = 0;
while (Offset < Length) {
@@ -179,10 +178,10 @@ _IsZeroMemory(
static __inline BOOLEAN
_IsZeroMemory(
- _In_ PCSTR Caller,
- _In_ PCSTR Name,
- _In_ PVOID Buffer,
- _In_ ULONG Length
+ _In_ PCSTR Caller,
+ _In_ PCSTR Name,
+ _In_reads_bytes_(Length) PVOID Buffer,
+ _In_ ULONG Length
)
{
UNREFERENCED_PARAMETER(Caller);
diff --git a/src/xenvbd/registry.c b/src/xenvbd/registry.c
index 4f7c5ef..d576990 100644
--- a/src/xenvbd/registry.c
+++ b/src/xenvbd/registry.c
@@ -1169,17 +1169,17 @@ fail1:
NTSTATUS
RegistryQueryBinaryValue(
- _In_ HANDLE Key,
- _In_ PSTR Name,
- _Outptr_ PVOID *Buffer,
- _Out_ PULONG Length
+ _In_ HANDLE Key,
+ _In_ PSTR Name,
+ _Outptr_result_bytebuffer_(*Length) PVOID *Buffer,
+ _Out_ PULONG Length
)
{
- ANSI_STRING Ansi;
- UNICODE_STRING Unicode;
- PKEY_VALUE_PARTIAL_INFORMATION Partial;
- ULONG Size;
- NTSTATUS status;
+ ANSI_STRING Ansi;
+ UNICODE_STRING Unicode;
+ PKEY_VALUE_PARTIAL_INFORMATION Partial;
+ ULONG Size;
+ NTSTATUS status;
RtlInitAnsiString(&Ansi, Name);
@@ -1256,7 +1256,7 @@ NTSTATUS
RegistryUpdateBinaryValue(
_In_ HANDLE Key,
_In_ PSTR Name,
- _In_ PVOID Buffer,
+ _In_reads_bytes_(Length) PVOID Buffer,
_In_ ULONG Length
)
{
@@ -1444,7 +1444,7 @@ fail1:
static PKEY_VALUE_PARTIAL_INFORMATION
RegistryAnsiToSz(
- PANSI_STRING Ansi
+ _In_ PANSI_STRING Ansi
)
{
ULONG Length;
@@ -1490,7 +1490,7 @@ fail1:
static PKEY_VALUE_PARTIAL_INFORMATION
RegistryAnsiToMultiSz(
- PANSI_STRING Ansi
+ _In_ PANSI_STRING Ansi
)
{
ULONG Length;
diff --git a/src/xenvbd/registry.h b/src/xenvbd/registry.h
index 26bc0c6..ba1eace 100644
--- a/src/xenvbd/registry.h
+++ b/src/xenvbd/registry.h
@@ -166,18 +166,18 @@ RegistryQuerySzValue(
extern NTSTATUS
RegistryQueryBinaryValue(
- _In_ HANDLE Key,
- _In_ PSTR Name,
- _Outptr_ PVOID *Buffer,
- _Out_ PULONG Length
+ _In_ HANDLE Key,
+ _In_ PSTR Name,
+ _Outptr_result_bytebuffer_(*Length) PVOID *Buffer,
+ _Out_ PULONG Length
);
extern NTSTATUS
RegistryUpdateBinaryValue(
- _In_ HANDLE Key,
- _In_ PSTR Name,
- _In_ PVOID Buffer,
- _In_ ULONG Length
+ _In_ HANDLE Key,
+ _In_ PSTR Name,
+ _In_reads_bytes_(Length) PVOID Buffer,
+ _In_ ULONG Length
);
extern NTSTATUS
--
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 |