Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
766 B

  1. #define UNICODE
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <windows.h>
  5. #include <winioctl.h>
  6. #include <shdcom.h>
  7. CHAR *ProgName = "cscgetinfo";
  8. CHAR buf[10000];
  9. _cdecl
  10. main(LONG argc, CHAR *argv[])
  11. {
  12. FILE *fh1;
  13. FILE *fh2;
  14. fh1 = fopen("\\\\jharperdc1\\vdo\\foo.txt", "r");
  15. if (fh1 == NULL) {
  16. printf("Open #1 failed %d\n", GetLastError());
  17. goto AllDone;
  18. }
  19. printf("ok1\n");
  20. while (fread(buf, sizeof(buf), 1, fh1) != 0)
  21. printf(".");
  22. printf("\n");
  23. fh2 = fopen("\\\\jharperdc1\\vdo\\foo.txt", "r+");
  24. if (fh2 == NULL) {
  25. printf("Open #2 failed %d\n", GetLastError());
  26. goto AllDone;
  27. }
  28. printf("ok2\n");
  29. AllDone:
  30. gets(buf);
  31. return 0;
  32. }