Announcement

Collapse
No announcement yet.

Wie kann eine Ramdisk erstellt werden?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Wie kann eine Ramdisk erstellt werden?

    Hallo,<br><br>gibt es eine Möglichkeit, unter Delphi 5 Ent. eine <b>RAM-DISK</b> zu erstellen?<br>

  • #2
    Versuche mal xmsdsk.exe. Findest du im web. Ist Freeware

    Comment


    • #3
      Hallo Michael,<br><br>hierbei habe ich eher an eine Erzeugung der RAM-Disk während des lfd. Windowsbetriebes gedacht, aber trotzdem vielen dank.<br><br>Unter Win9x kann man sich auch anders behelfen: Bootdisk von Win98 erstellen, diese erzeugt beim Booten eine RAM-Disk und müsste kompatibel sein.<br&gt

      Comment


      • #4
        Hallo Stephan

        wie willst du diese RAM-Disk denn dann nutzen? Das geht vielleicht unter DOS, obwohl ich es unter Windows auch gehen sollte.

        Wie, würde mich auch interessieren, d.h. wenn möglich mit source.

        Tschüss Ti

        Comment


        • #5
          Hallo,<p>
          sorry, wenn ich mich da mal einmische :-)<p>
          Ich sehe nicht ganz den Sinn in einer RAM-Disk. Bei der Windows 98 Bootdiskette wird eine RAM-Disk benötigt, um die gepackten Dateien zu entpacken, da auf der Diskette nicht genügende freier Speicher für alle Dateien/Programme bereitsteht. Die Dateien werden auf der Festplatte - und NICHT im Arbeitsspeicher - gespeichert/geladen. Verwendet man z.B.: eine nicht-formatierte Festplatte, so kann keine RAM-Disk erstellt werden.<p>
          Wenn Du jetzt aber lange Verzeichnisse direkt über einen Laufwerksbuchstaben ansprechen möchtest, dann würde ich auf einen uralt DOS-Befehl zurückgreifen: <b>SUBST</b> Du kannst ja den Befehl von Deinem Programm aus im Hintergrund starten. Sobald ein Verzeichnis einem Laufwerksbuchstaben zugeordnet ist, steht dieser sofort - auch in Windows - bereit

          Comment


          • #6
            Hallo Tim,<br><br>wir entwickeln 32-Bit-Anwendungen. Von einer 32-Bit-DLL muss ich auf eine 16-Bit-DLL zugreifen, dies bewerkstellige ich mit einer 16-Bit-EXE, die wiederum eine Textdatei mit dem Resultat anlegt.<br>Die 16-bit-DLL bekommt einen Dateinamen übergeben und diese Datei wird verschlüsselt. Es gibt aber große Probleme, wenn der Verzeichnisname der zu verschlüsselnden Datei mehr wie 8 Zeichen hat.<br>Leider muss ich die Verschlüsselung mit der 16-Bit-Datei durchführen.<br><br>Da ich nicht unnötig ein Temp-Verzeichnis in einem Hauptverzeichnis eines Lwk's anlegen möchte, kam mir der Gedanke eine RAM-Disk zu erzeugen, hier wüsste ich aber nicht wie!<br&gt

            Comment


            • #7
              Hi,

              Gruseliges Konstrukt... ;-)

              Gruß
              Gesin

              Comment


              • #8
                Hallo,

                da muss ich Gesine Recht geben ;-)

                Ich habe zu subst noch folgende Unit gefunden:
                <pre>
                unit Subst9x;

                {
                API for work with substitution device (see dos command "subst").
                Win9x ONLY. For WinNT and Win2000 use native API call.
                Last rev. 30 Sep 2000

                Delphi 2,3,4,5
                Freware with source.

                Copyright (c) 2000, SoftLab
                Web http://softlab.od.ua/
                Email [email protected]

                THIS SOFTWARE AND THE ACCOMPANYING FILES ARE DISTRIBUTED
                "AS IS" AND WITHOUT WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR
                ANY OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED.
                NO WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED.
                THE USER MUST ASSUME THE ENTIRE RISK OF USING THE ACCOMPANYING CODE.

                Permission is granted to anyone to use this software for any purpose,
                including commercial applications, and to alter it and redistribute it
                freely, subject to the following restrictions:

                1. The origin of this software must not be misrepresented, you must
                not claim that you wrote the original software. If you use this software
                in a product, an acknowledgment in the product documentation
                would be appreciated but is not required.
                2. Altered source versions must be plainly marked as such, and must not be
                misrepresented as being the original software.
                3. Original copyright may not be removed or altered from any source
                distribution.
                }

                interface

                uses Windows, SysUtils;

                function SubstCreate(DriveLetter: Char; const Path: string): Boolean;
                // create subst device. Path must be a real folder.

                function SubstRemove(DriveLetter: Char): Boolean;
                // destroy subst device.

                function SubstQuery(DriveLetter: Char): string;
                // get Path for subst device.
                // return empty string if DriveLetter is not subst-device

                implementation

                procedure VxDCall; external kernel32 index 1;

                function SubstCreate(DriveLetter: Char; const Path: string): Boolean;
                var drvno: byte;
                buff: array[0..256] of char;
                FPath: string;

                function AddSlash(const Path: string): string; {äîáàâëÿåì \ åñëè íàäî}
                begin
                if (Path = '') or (Path[Length(Path)] <> '\') then Result:=Path+'\'
                else Result:=Path;
                end;

                begin
                if Path[Length(Path)] = '\' then
                FPath:=Copy(Path,1,Length(Path)-1)
                else
                FPath:=Path;
                FPath:=ExtractShortPathName(FPath);
                if FPath <> '' then begin
                drvno:=Ord(UpperCase(DriveLetter)[1])-64;
                StrPCopy(buff,FPath);
                asm
                pushad
                push es
                xor ebx, ebx
                mov bh,0
                mov bl,drvno
                lea edx,buff
                push 0 //ECX (unused)
                push 71AAh
                push 2A0010h
                call VxDCall
                pop es
                popad
                end;
                end;
                Result:=ANSIUpperCase(AddSlash(SubstQuery(DriveLet ter))) = ANSIUpperCase(AddSlash(Path));
                end;

                function SubstRemove(DriveLetter: Char): Boolean;
                var drvno: byte;
                begin
                drvno:=Ord(UpperCase(DriveLetter)[1])-64;
                asm
                pushad
                push es
                xor ebx, ebx
                mov bh,1
                mov bl,drvno
                push 0 //ECX (unused)
                push 71AAh
                push 2A0010h
                call VxDCall
                pop es
                popad
                end;
                Result:=SubstQuery(DriveLetter) = '';
                end;

                function SubstQuery(DriveLetter: Char): string;
                var drvno: byte;
                buff: array[0..256] of char;
                lbuff: array[0..256] of char;
                begin
                drvno:=Ord(UpperCase(DriveLetter)[1])-64;
                buff[0]:=#0;
                asm
                pushad
                push es
                xor ebx, ebx
                mov bh,2
                mov bl,drvno
                lea edx,buff
                push 0 //ECX (unused)
                push 71AAh
                push 2A0010h
                call VxDCall
                pop es
                popad
                end;
                Result:=StrPas(buff);
                if Result = '' then Exit;
                // convert to longfilename
                asm
                // expand long path
                pushad
                push ds
                push es
                xor ebx, ebx
                lea esi, buff
                lea edi, lbuff
                &#10

                Comment


                • #9
                  ...
                  <pre>
                  mov ecx,0
                  mov cl, 2
                  mov ch, 0
                  push ECX
                  push 7160h
                  push 2A0010h
                  call VxDCall
                  pop es
                  pop ds
                  popad
                  end;
                  Result:=StrPas(lbuff);
                  end;
                  </pre>

                  Tschüss Ti

                  Comment

                  Working...
                  X