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.

49 lines
1.3 KiB

  1. #include <nt.h>
  2. #include <ntrtl.h>
  3. #include <nturtl.h>
  4. #include <windows.h>
  5. #include <stdio.h>
  6. #include <stdlib.h>
  7. #include <string.h>
  8. #include <time.h>
  9. #include <cscapi.h>
  10. #include "lmcons.h"
  11. #include "lmuse.h"
  12. VOID __cdecl
  13. main(
  14. int argc,
  15. char *argv[])
  16. {
  17. // PWCHAR pFileName = L"\\\\jharperdc1\\vdo\\xx\\yy.txt";
  18. PWCHAR pFileName = L"\\\\jharperdc1\\jim\\jim.txt";
  19. DWORD Status = 0;
  20. DWORD PinCount = 0;
  21. DWORD HintFlags = 0;
  22. DWORD UserPerms = 0;
  23. DWORD OtherPerms = 0;
  24. DWORD QueryStatus = 0;
  25. QueryStatus = CSCQueryFileStatusExW(
  26. pFileName,
  27. &Status,
  28. &PinCount,
  29. &HintFlags,
  30. &UserPerms,
  31. &OtherPerms);
  32. printf("CSCQueryFileStatus(%ws) returned %d(0x%x)\n", pFileName, QueryStatus, QueryStatus);
  33. if (QueryStatus > 0) {
  34. printf(
  35. "Status: 0x%x\n"
  36. "PinCount: 0x%x\n"
  37. "HintFlags: 0x%x\n"
  38. "UserPerms: 0x%x\n"
  39. "OtherPerms: 0x%x\n",
  40. Status,
  41. PinCount,
  42. HintFlags,
  43. UserPerms,
  44. OtherPerms);
  45. }
  46. }