void doWrite(int n)
{
char *buf,*f;
ULONG nWritten;
int i;
int j;
buf = (char *) malloc(n);
if (buf == NULL)
{
printf("Failed to allocate buffer for write");
Exit(1);
}
for (i=0;i<32;i++)
{
buf = i;
}
// Write data to driver
printf("Writing to device - ");
WriteFile(hDevice, buf, n, &nWritten, NULL);
printf("%d bytes written to device (%d attempted).\n", nWritten, n);