#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <ndk/ntndk.h>
#include <ntddscsi.h>
#include <scsi.h>
Go to the source code of this file.
◆ _NTSCSI_USER_MODE_
◆ NTOS_MODE_USER
◆ WIN32_NO_STATUS
◆ GetInquiryData()
Definition at line 22 of file diskspeed.c.
23{
31
35 0,
36 &ScsiAddress,
37 sizeof(ScsiAddress),
38 &dwReturned,
41 {
43 }
47 0,
50 &dwReturned,
53 {
56 {
59 {
60 while (1)
61 {
64 InquiryBuffer->
Lun == ScsiAddress.
Lun)
65 {
68 }
70 {
71 break;
72 }
74 }
75 }
76 }
77 }
79}
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memcpy(s1, s2, n)
#define IOCTL_SCSI_GET_ADDRESS
struct _SCSI_INQUIRY_DATA * PSCSI_INQUIRY_DATA
#define IOCTL_SCSI_GET_INQUIRY_DATA
struct _SCSI_ADAPTER_BUS_INFO * PSCSI_ADAPTER_BUS_INFO
ULONG NextInquiryDataOffset
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Referenced by main().
◆ main()
Definition at line 83 of file diskspeed.c.
84{
87
96
98
99
101 while (1)
102 {
109 0,
112 {
114 {
116 }
117 else
118 {
120 }
121 break;
122 }
124 {
125 printf(
"Transfer Size (kB) 1 2 4 8 16 32 64 128 256\n");
126 printf(
"Transfer Rate (MB/s)\n");
127 printf(
"-------------------------------------------------------------------------------\n");
128
130 }
133 {
135 }
136 else
137 {
139 }
142 while (
Size <= 256 * 1024)
143 {
145 dwReadTotal = 0;
146
149 {
152 {
153 dwReadTotal += dwReturned;
155 }
156 }
157 dwReadTotal /= 2048;
158 printf(
"%3ld.%ld ", dwReadTotal / 1024, (dwReadTotal % 1024) * 10 / 1024);
160 }
164 }
166
167
168 return 0;
169}
BOOL GetInquiryData(HANDLE hDevice, PINQUIRYDATA InquiryData)
#define ReadFile(a, b, c, d, e)
#define INVALID_HANDLE_VALUE
DWORD WINAPI GetTickCount(VOID)
#define sprintf(buf, format,...)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
LPVOID NTAPI VirtualAlloc(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flAllocationType, IN DWORD flProtect)
BOOL NTAPI VirtualFree(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD dwFreeType)