Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - Alternate Function for CreateFile on .NET Framework,...

Reply
 
Old 04-30-2008   #1 (permalink)
Kerem Gümrükcü


 
 

Alternate Function for CreateFile on .NET Framework,...

Hi all,

sorry for Crossposting, but i dont know whether someone
can help me here. If i remember right, there was a Class
or a Member function in the .NET Framework that could
do mostly the same as CreateFile can do for me, but i
cant remember its Name. By saying the "same" i mean
i was able to use it to open Handles to Devices and anything
that could be opened with CreateFile and had a Symbolic
Name that has been exported from Kernel to User-Space.
But i cant remember the class/member name. I am sure there
was something inside the .NET FW and natively supported
by the .NET. AFAIK it was also something MS used internally
in its base classes, but it was exposed to any programmer and
was public/static or whatever available from the CLR/.NET.
I really cant remember its name, but i used something in the past
years ago for opening something, if i remember right to a drive.
I think i used it the first time with .NET 2.0...

Anybody can help me here, or am i remembering something wrong?


Regards

Kerem

-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."



My System SpecsSystem Spec
Old 04-30-2008   #2 (permalink)
Peter Duniho


 
 

Re: Alternate Function for CreateFile on .NET Framework,...

On Wed, 30 Apr 2008 17:15:57 -0700, Kerem Gümrükcü <kareem114@xxxxxx>
wrote:
Quote:

> sorry for Crossposting, but i dont know whether someone
> can help me here.
No doubt someone else with more patience will see and actually answer your
specific question.

So I'll just take this opportunity to chide you for knowingly excessively
cross-posting. Strictly speaking, m.p.d.framework is the only on-topic
newsgroup. Based on customary usage, m.p.d.languages.csharp is also
reasonable. None of the others are.

If you actually want to call CreateFile(), the m.p.d.framework.interop
newsgroup would be great. But that's not what you're asking. And this
definitely isn't a question about the CLR, as whatever it is you're
looking for would be exposed in the Framework, not the CLR.

I suppose I should be thankful you cross-posted rather than multi-posted.
And really, I am. But please, don't cross-post like that again. It's
excessive.

And by the way, since some people will refuse to answer questions not
posted in a more polite way, ironically you are potentially limiting your
audience rather than expanding it by cross-posting like that (it all
depends on whether the number of additional people seeing the question is
greater than the number of people who ignore it because it was excessively
cross-posted).

Pete
My System SpecsSystem Spec
Old 05-01-2008   #3 (permalink)
Willy Denoyette [MVP]


 
 

Re: Alternate Function for CreateFile on .NET Framework,...

"Kerem Gümrükcü" <kareem114@xxxxxx> wrote in message
news:%23MTM3CyqIHA.4280@xxxxxx
Quote:

> Hi all,
>
> sorry for Crossposting, but i dont know whether someone
> can help me here. If i remember right, there was a Class
> or a Member function in the .NET Framework that could
> do mostly the same as CreateFile can do for me, but i
> cant remember its Name. By saying the "same" i mean
> i was able to use it to open Handles to Devices and anything
> that could be opened with CreateFile and had a Symbolic
> Name that has been exported from Kernel to User-Space.
> But i cant remember the class/member name. I am sure there
> was something inside the .NET FW and natively supported
> by the .NET. AFAIK it was also something MS used internally
> in its base classes, but it was exposed to any programmer and
> was public/static or whatever available from the CLR/.NET.
> I really cant remember its name, but i used something in the past
> years ago for opening something, if i remember right to a drive.
> I think i used it the first time with .NET 2.0...
>
> Anybody can help me here, or am i remembering something wrong?
>
>
> Regards
>
> Kerem
>
> -----------------------
> Beste Grüsse / Best regards / Votre bien devoue
> Kerem Gümrükcü
> Microsoft Live Space: http://kerem-g.spaces.live.com/
> Latest Open-Source Projects: http://entwicklung.junetz.de
> -----------------------
> "This reply is provided as is, without warranty express or implied."
>
>


No, you are mistaken, the FW does not expose the Win32 CreateFile API,
you'll have to PInvoke and use the handle returned in .NET IO API's that
take an handle.
Please consult the archive subject: "Driver device IO control by C#" for
more details on the CreateFile PInvoke declaration.

Willy.



My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
can't update .NET Framework 3.5 Service Pack 1 and .NET Framework 3.5(KB951847 Windows Updates
Createfile file name error General Discussion
CreateFile() failed with error 998!! General Discussion
About CreateFile on vista? Vista security
Vista CreateFile() access denied Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46