Source code of Windows XP (NT5)
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.

34 lines
730 B

  1. #include <windows.h>
  2. #include <stdio.h>
  3. #include <ctype.h>
  4. #include <ftapi.h>
  5. void __cdecl
  6. main(
  7. int argc,
  8. char** argv
  9. )
  10. {
  11. UCHAR driveLetter;
  12. FT_LOGICAL_DISK_ID diskId;
  13. BOOL b;
  14. if (argc != 3 || argv[1][1] != ':') {
  15. printf("usage: %s <drive:> <DiskId>\n", argv[0]);
  16. return;
  17. }
  18. driveLetter = (UCHAR)toupper(argv[1][0]);
  19. sscanf(argv[2], "%I64X", &diskId);
  20. printf("Creating a symbolic link from %c: to %I64X\n", driveLetter, diskId);
  21. b = FtSetStickyDriveLetter(diskId, driveLetter);
  22. if (b) {
  23. printf("Symbolic link created.\n");
  24. } else {
  25. printf("Symbolic link create failed with %d\n", GetLastError());
  26. }
  27. }