Danke
Habe es jetzt so gemacht.
Delphi-Quellcode:
Procedure CreateVirtualDrive(VHDD_Size : integer);
var DriveX: Char;
i, i1 : integer;
str : string;
begin
//GetFreeDriveLetter
for I := 0 to 25 do
if (not DriveExists(I)) then
begin
ListBox2.Items.Add(Chr(I + Ord('A')));
end;
for I1 := 0 to 1 do
begin
str := listbox2.items[i1];
DriveX:=str[i1];
end;
//SetDriveLetter
if GetDiskIn(DriveX)= false then
begin
DriveHandle := CreateVirtualDriveEx(DriveX,VHDD_Size,@OnRead, @OnWrite,false,0);
Es geht so richtig gut
DANKE noch mal