|
-
April 16th, 2010, 03:36 AM
#1
WriteFile writes zero's instead of my bytes
Code in C++:
short buffer[6];
buffer[0] = 1;
buffer[1] = 2;
buffer[2] = 3;
buffer[3] = 4;
buffer[4] = 5;
buffer[5] = 6;
short *p = &buffer[0];
int bufflen = 6;
int ret;
WriteFile(g_handle, p, bufflen, &ret, NULL);
After executing ret = 6 and WriteFile is a success. But when i open file with hex editor i see this:
01 00 02 00 03 00
So basically WriteFile wrote my byte then zero, then my byte, then zero again. Is this bug? Or i am doing something wrong? Thanks for help.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|