|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 13/17] ioctl: fix annotation of __CaptureUserBuffer
*CapturedBuffer can be both Null or filled with Buffer on success path,
so depending on the passed Length of the buffer that needs to be captured
we annotate *CapturedBuffer accordingly.
Signed-off-by: Césaire Mounah <cesaire.mounah@xxxxxxxxxx>
---
src/xeniface/ioctls.c | 4 +++-
src/xeniface/ioctls.h | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/xeniface/ioctls.c b/src/xeniface/ioctls.c
index dec68d7..f9c959e 100644
--- a/src/xeniface/ioctls.c
+++ b/src/xeniface/ioctls.c
@@ -44,7 +44,9 @@ NTSTATUS
__CaptureUserBuffer(
_In_ PVOID Buffer,
_In_ ULONG Length,
- _Outptr_ PVOID *CapturedBuffer
+ _When_(Length != 0, _Outptr_result_bytebuffer_(Length))
+ _When_(Length == 0, _Outptr_result_maybenull_)
+ PVOID *CapturedBuffer
)
{
NTSTATUS Status;
diff --git a/src/xeniface/ioctls.h b/src/xeniface/ioctls.h
index 71d74d3..59e186f 100644
--- a/src/xeniface/ioctls.h
+++ b/src/xeniface/ioctls.h
@@ -93,7 +93,9 @@ NTSTATUS
__CaptureUserBuffer(
_In_ PVOID Buffer,
_In_ ULONG Length,
- _Outptr_ PVOID *CapturedBuffer
+ _When_(Length != 0, _Outptr_result_bytebuffer_(Length))
+ _When_(Length == 0, _Outptr_result_maybenull_)
+ PVOID *CapturedBuffer
);
VOID
--
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 |