Status = WriteFile(FileHandle,“nwebuf”,6,&BytesWritten,NULL);
printf(“status is %d get last error is %d \n”,Status,GetLastError());
CloseHandle(FileHandle);
return ;
}
but writefile returns an error of 87 (Invalid parameter).
My question is can writefile be used to access the volume in this way?
If not, is there a way to do a write onto the raw disk from user space?
>Hi, > I have written this code to write on to a removable disk without a file >system on it. > >void main(void) >{ > HANDLE FileHandle; > BOOL Status = TRUE; > unsigned long BytesWritten = 0; > FileHandle = CreateFile(“\\.\f:”, > ( GENERIC_READ | GENERIC_WRITE ), > ( FILE_SHARE_READ | FILE_SHARE_WRITE ), > NULL, > OPEN_EXISTING, > 0, > NULL > ); > if (FileHandle == INVALID_HANDLE_VALUE) > { > printf(“error is d \n”,GetLastError()); > return ; > } > > Status = WriteFile(FileHandle,“nwebuf”,6,&BytesWritten,NULL); > > printf(“status is d get last error is d \n”,Status,GetLastError()); > > CloseHandle(FileHandle); > > return ; > > > >} > >but writefile returns an error of 87 (Invalid parameter). >My question is can writefile be used to access the volume in this way? >If not, is there a way to do a write onto the raw disk from user space? > >Thanks, >Chhavi > > >— >You are currently subscribed to ntfsd as: mattwu@163.com >To unsubscribe send a blank email to %%email.unsub%% >.
Status = WriteFile(FileHandle,“nwebuf”,6,&BytesWritten,NULL);
printf(“status is %d get last error is %d \n”,Status,GetLastError());
CloseHandle(FileHandle);
return ;
}
but writefile returns an error of 87 (Invalid parameter).
My question is can writefile be used to access the volume in this way?
If not, is there a way to do a write onto the raw disk from user space?