windows-nt/Source/XPSP1/NT/drivers/ftapi/ftorphan/ftorphan.c
2020-09-26 16:20:57 +08:00

34 lines
677 B
C

#include <windows.h>
#include <stdio.h>
#include <ftapi.h>
void __cdecl
main(
int argc,
char** argv
)
{
FT_LOGICAL_DISK_ID diskId;
int memberNumber;
BOOL b;
if (argc != 3) {
printf("usage: %s <diskId> <memberNumber>\n", argv[0]);
return;
}
sscanf(argv[1], "%I64X", &diskId);
sscanf(argv[2], "%d", &memberNumber);
printf("Orphaning member %d on %I64X...\n", memberNumber, diskId);
b = FtOrphanLogicalDiskMember(diskId, (WORD) memberNumber);
if (b) {
printf("Member orphaned.\n");
} else {
printf("Orphaning failed with %d\n", GetLastError());
}
}