#include <windows.h>
#define SIZE 1124
int main() {
HANDLE h = _fileno(_getstdfilex(1));
char buf[SIZE];
memset(buf,'x',SIZE);
unsigned int count = 0;
printf("About to call WriteFile()\n");
int result = WriteFile(h,buf,SIZE,&count,NULL);
printf("\n");
printf("WriteFile returns %d\n",result);
}
It never gets as far as "WriteFile returns...". If you change SIZE to something small like 124 it works.
No comments:
Post a Comment