English
Forum

File in RAM create

 
- Page 1 -



Jac
de
Lad
Hello Community!

with the API CreateFile can each crowd verschiedener Files create. I Search a Possibility a File quasi in the RAM to create circa then through of/ one DLL-function hereon access, something so To make and the File subsequently again To delete. so would I a temporary File surrounding, what in the first faster is and secondly simply schöner. knows itself someone so from? I come with the Help not clear, there's the etliche Parameter with hunderten Opportunities...

Jac
 
Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE)
Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP
04/18/08  
 



 
- Page 1 -


string a&,0=Blub
 
04/19/08  
 




Jac
de
Lad
I Have me in the MSDN The APIs respected, but I come lest clear. have you got possible one Minimalbeispiel?

Jac
 
Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE)
Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP
04/19/08  
 



in the momentum not - The pipeUnit raspelt much there-and-since so these hardly shows as simply goes...
 
04/19/08  
 




Jac
de
Lad
this is badly. nevertheless thanks, I look me time moreover circa.
 
Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE)
Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP
04/19/08  
 




Frank
Abbing

I Search a Possibility a File quasi in the RAM to create circa then through of/ one DLL-function hereon access, something so To make and the File subsequently again To delete.


hears itself for me on like a stinknormaler Speicherbereich. Übergib simply a Zeiger on the memory on The Dll-function, z.B. NeueFunktion(area#)
 
04/19/08  
 



is correct, it brauchs Yes not at all prozessübergreifend, be because The DLL runs in another Process...
 
04/20/08  
 




Andreas
Miethe


Frank Abbing
Frank Abbing
I Search a Possibility a File quasi in the RAM to create circa then through of/ one DLL-function hereon access, something so To make and the File subsequently again To delete.


hears itself for me on like a stinknormaler Speicherbereich. Übergib simply a Zeiger on the memory on The Dll-function, z.B. NeueFunktion(area#)


won't functions !
so How I the understood have, should a File, The only Ram lying, with a Filenames addressed go.

example:

an EXE becomes through Datengenerator into Exe eingebunden.
there have I mean EXE in the Speicherbereich.
now attempt time with the Kernel32.Dll by CreateProcess() the thing to work to catch.
there becomes no Speicherbereich separate one Dateiname expects.
always if a Dll-function a Zeiger on a Filenames expects, and of it there a crowd, becomes the so not functions.

Please berichtige me if I there wrong lie !
 
Gruss
Andreas
________ ________ ________ ________ _
Profan 3.3 - XProfanX2
Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit
ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher
Homepage :  [...] 
04/20/08  
 




Frank
Abbing

Please berichtige me if I there wrong lie !


You lie there sure not wrong. The thing with the Filenames have I aware outer to held, because I like this gone out was, that Jac The Dll yourself created. For this found I The engineering over The reaches plenty sinnvoller. the goes but with of/ one strangers Dll not.

but i am sure, that too a Exedatei from memory launched go can. still does it indeed with Dlls (Memorymodule) and these are so too Exedateien.
however, everything in everything is iFs Solution vorzuziehen. i am sure, it supply Jac yet a short Democode moreover.
 
04/20/08  
 




Andreas
Miethe


Hello Frank,

is a integrally others story, if The Dll self written becomes.
of it I'm going but not from.

Jac
but how can I The File benefit, if The function the DLL a Zeiger on a Filenames needed?

Jac
 
Gruss
Andreas
________ ________ ________ ________ _
Profan 3.3 - XProfanX2
Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit
ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher
Homepage :  [...] 
04/20/08  
 



 
- Page 2 -



Jac
de
Lad
No, No, No.

The following:

an DLL xyz needed for a operation a Filenames (for may part becomes The File loaded and under another stature again stored). I beget The File but only temporär, because Profan The File x only in another stature produce can. i will now these temporary File bypass, because it me too slow is, that The on the Festplatte prepares becomes. therefore Search I after a Possibility, that The File nevertheless prepares becomes, but the spending into RAM detoured becomes. The File must naturally nevertheless under one Filenames ansprechbar his, there otherwise The DLL xyz not any more goes.

know your now I my?
Jac
 
Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE)
Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP
04/20/08  
 




Sebastian
König
Jac
No, No, No.

The following:

an DLL xyz needed for a operation a Filenames (for may part becomes The File loaded and under another stature again stored). I beget The File but only temporär, because Profan The File x only in another stature produce can. i will now these temporary File bypass, because it me too slow is, that The on the Festplatte prepares becomes. therefore Search I after a Possibility, that The File nevertheless prepares becomes, but the spending into RAM detoured becomes. The File must naturally nevertheless under one Filenames ansprechbar his, there otherwise The DLL xyz not any more goes.

know your now I my?
Jac


an Possibility, The me straight falls in, would Perhaps CreateNamedPipe(). such Objects get a names to the schema \.pipepipename and can with CreateFile() open, so one tappt im dunkeln most likely on The function as via their File-Namens transfer could. the schwierige on the thing is though, that one itself in the aufrufenden Process around the describe the Pipe concern must - very difficult, because the whole should parallel to the Funktionaufruf happen, means in a own Thread run out (what with Profan2Cpp well functions would). unfortunately have I in momentum extreme little Time, so I no example supplying can, but I will be into next Meet time something try...

Perhaps has but someone another better, i.e. einfachere idea...

MfG

Sebastian
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
04/20/08  
 




Sebastian
König
so, here's now time an example. in the principle functions it - anyway by me. The procedure TestProc is a Dummy for DLL-function: tappt im dunkeln opens The File over ihren names and reads whom Content, To nothing more to that reading available is. unfortunately lying here (most likely) too The large Einschränkung the Konzepts: the whole functions well only, if the reading on these Nature and point stattfindet and not somehow first of all The Filesize determined and then everything on one red becomes. a attempt is Perhaps nevertheless worth...
CompileMarkSeparation
 $H Windows.ph
 $IFNDEF P2CPP
Cls
Print Der Code funktioniert leider nur mit Profan2Cpp - Sorry!
Print
Print Taste zum Beenden.
WaitKey
End
 $ENDIF
var pipe$ = \\.\pipe\sk-testpipe
var signal& = ~CreateEvent(0,0,0,0)
declare data#
dim data#,1024 * 100 100 KB
clear data#
Bereich füllen...
declare error&

proc WriteThreadProc

    parameters lpParams&
    P2CPP: <USE_EXTERNAL_ST>
    var pipe& = ~CreateNamedPipe(Addr(pipe$),~PIPE_ACCESS_OUTBOUND,~PIPE_TYPE_BYTE | ~PIPE_WAIT,1,1024,1024,500,0)

    if pipe& = ~INVALID_HANDLE_VALUE

        error& = ~GetLastError()
        ~SetEvent(signal&)
        ~ExitThread(1)

    endif

    ~SetEvent(signal&)
    ~ConnectNamedPipe(pipe&,0)
    var dwTotalAvail& = SizeOf(data#)
    var dwTotalWritten& = 0
    var dwWritten& = 0

    while dwTotalWritten& < dwTotalAvail&

        dwWritten& = 0
        ~WriteFile(pipe&,data# + dwTotalWritten&,1024,Addr(dwWritten&),0)
        dwTotalWritten& = dwTotalWritten& + dwWritten&
        ~Sleep(0)

    endwhile

    ~FlushFileBuffers(pipe&)
    ~DisconnectNamedPipe(pipe&)
    ~CloseHandle(pipe&)
    ~ExitThread(0)
    P2CPP: </USE_EXTERNAL_ST>

endproc

proc TestProc

    parameters filename$
    declare file&
    var file& = ~CreateFile(Addr(filename$),~GENERIC_READ,0,0,~OPEN_EXISTING,0,0)
    Color 12,15
    Print Datei-Handle:,file&

    if file& = ~INVALID_HANDLE_VALUE

        Print WinError$(error&)
        WaitKey
        End

    endif

    var dwTotalRead& = 0
    var dwRead& = 0
    declare buffer#
    dim buffer#,1024

    while ~ReadFile(file&,buffer#,1024,Addr(dwRead&),0)

        dwTotalRead& = dwTotalRead& + dwRead&
        dwRead& = 0

    endwhile

    ~CloseHandle(file&)
    Print Int(dwTotalRead&  1024),KB gelesen
    Print
    dispose buffer#

endproc

Cls
declare id&
var thread& = ~CreateThread(0,0,ProcAddr(WriteThreadProc,1),0,0,Addr(id&))
Print Thread-ID:,id&
Print Thread-Handle:,thread&
Print
~WaitForSingleObject(signal&,~INFINITE)
~CloseHandle(signal&)
TestProc pipe$
~CloseHandle(thread&)
dispose data#
Color 0,15
Print Taste zum Beenden.
WaitKey
End

HTH

Sebastian
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
04/21/08  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.021 Views

Untitledvor 0 min.
Jörg Sellmeyer06/12/18
Ernst05/12/14

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie