From 77cbdf342ca05a8f21c316e58395576e954d857b Mon Sep 17 00:00:00 2001 From: Noel Power Date: Mon, 8 Jan 2024 15:56:38 +0000 Subject: [PATCH] s3/utils: use full 64 bit address for getrows (with 64bit offsets) if 64bit offsets are used the hi 32-bits of address are stored in the ulreserved2 member of the message header field and the low 32-bits are stored in the ulclientbase member of the cpmgetrows message Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett (cherry picked from commit 6ecb614b8ec6953ba15e8061fce9b395615b035a) --- source3/utils/wspsearch.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/source3/utils/wspsearch.c b/source3/utils/wspsearch.c index 2c56c97736b..063b952d468 100644 --- a/source3/utils/wspsearch.c +++ b/source3/utils/wspsearch.c @@ -350,6 +350,10 @@ static NTSTATUS create_getrows(TALLOC_CTX *ctx, uint32_t INITIAL_ROWS = 32; uint32_t requested_rows = INITIAL_ROWS; uint32_t rows_printed; + uint64_t baseaddress; + uint32_t offset_lowbits = 0xdeabd860; + uint32_t offset_hibits = 0xfeeddeaf; + TALLOC_CTX *row_ctx; bool loop_again; @@ -377,10 +381,24 @@ static NTSTATUS create_getrows(TALLOC_CTX *ctx, skip, requested_rows, 40, - 0xDEAbd860, + offset_lowbits, bindings->brow, 0); + if (is_64bit) { + /* + * MS-WSP 2.2.2 + * ulreservered holds the high 32-bits part of + * a 64-bit offset if 64-bit offsets are being used. + */ + request->header.ulreserved2 = offset_hibits; + baseaddress = request->header.ulreserved2; + baseaddress <<= 32; + baseaddress += offset_lowbits; + } else { + baseaddress = offset_lowbits; + } + status = wsp_request_response(request, wsp_ctx, request, @@ -419,7 +437,7 @@ static NTSTATUS create_getrows(TALLOC_CTX *ctx, is_64bit, disp_all_cols, bindings, 40, - 0xDEAbd860, + baseaddress, response->message.cpmgetrows.rowsreturned, &rows_printed); if (!NT_STATUS_IS_OK(status)) { -- 2.47.3