diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2015-07-16 00:52:08 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2015-07-16 00:52:08 +0300 |
commit | 3352af5cd8a8f9882eb11554a6a36a37b23f56ac (patch) | |
tree | 219acb625f735c4a348497e8e3857d4c6042bbc2 /src | |
parent | libnt_path_converter: code style (diff) | |
download | windows7-drivers-3352af5cd8a8f9882eb11554a6a36a37b23f56ac.tar.gz windows7-drivers-3352af5cd8a8f9882eb11554a6a36a37b23f56ac.zip |
test: store received values
Diffstat (limited to 'src')
-rw-r--r-- | src/test/device.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/test/device.c b/src/test/device.c index 80b2392..3baadbd 100644 --- a/src/test/device.c +++ b/src/test/device.c @@ -36,6 +36,8 @@ static NTSTATUS handle_say_hello( return STATUS_SUCCESS; } +static unsigned int i = 42; + static NTSTATUS handle_exchange_ints( void *in_buf, unsigned long in_buf_size, @@ -43,21 +45,20 @@ static NTSTATUS handle_exchange_ints( unsigned long out_buf_size, ULONG_PTR *nbwritten) { - unsigned int read; - unsigned int written = 0xdeadbeef; + unsigned int temp_i; - if (in_buf_size != sizeof(read)) + if (in_buf_size != sizeof(temp_i)) return STATUS_INVALID_BUFFER_SIZE; - RtlCopyMemory(&read, in_buf, in_buf_size); - DbgPrint("%08x\n", read); + RtlCopyMemory(&temp_i, in_buf, in_buf_size); + DbgPrint("%08x\n", temp_i); - if (out_buf_size < sizeof(written)) + if (out_buf_size < sizeof(i)) return STATUS_BUFFER_TOO_SMALL; - RtlCopyMemory(out_buf, &written, sizeof(written)); - *nbwritten += sizeof(written); - + RtlCopyMemory(out_buf, &i, sizeof(i)); + *nbwritten += sizeof(i); + i = temp_i; return STATUS_SUCCESS; } |