Direct disk writing

B

Bluuuuuue Rajah

Does anybody know what are the names of the Win32 system calls for direct
reading and writing of disk sectors, rather than the NTFS routines?
 
K

Kenny McCormack

Does anybody know what are the names of the Win32 system calls for direct
reading and writing of disk sectors, rather than the NTFS routines?

Off topic. Not portable. Cant discuss it here. Blah, blah, blah.

P.S. Note that this was posted to many groups, and is on-topic in most
of them. Too bad about that. The rules clearly state that if you post
to CLC, you deserve to have your thread de-railed by us CLC-loonies.

Tough break...

--
Useful clc-related links:

http://en.wikipedia.org/wiki/Aspergers
http://en.wikipedia.org/wiki/Clique
http://en.wikipedia.org/wiki/C_programming_language
 
K

Kira Qian

Does anybody know what are the names of the Win32 system calls for direct
reading and writing of disk sectors, rather than the NTFS routines?

Do you mean write file into hard drive with a file name?

Look at the following sample, I am not sure whether this is what you
want.

HANDLE hFile;
DWORD wmWritten;
char strData[] = "Test data written to explain the win32 file sample";
hFile = CreateFile("C:\\test.txt",GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
WriteFile(hFile,strData,(DWORD)(sizeof(strData)),&wmWritten,NULL);
CloseHandle(hFile);

PS: I don't think this is an off topic thread.
 
T

Tech07

Kira said:
Does anybody know what are the names of the Win32 system calls for
direct reading and writing of disk sectors, rather than the NTFS
routines?

Do you mean write file into hard drive with a file name?

Look at the following sample, I am not sure whether this is what you
want.

HANDLE hFile;
DWORD wmWritten;
char strData[] = "Test data written to explain the win32 file sample";
hFile = CreateFile("C:\\test.txt",GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
WriteFile(hFile,strData,(DWORD)(sizeof(strData)),&wmWritten,NULL);
CloseHandle(hFile);

PS: I don't think this is an off topic thread.

(SHHHHHhhhhhhh! The "topicality" debaters will hear you and it will be WWIII
again.)
 
N

Nick Keighley

Does anybody know what are the names of the Win32 system calls for direct
reading and writing of disk sectors, rather than the NTFS routines?

Do you mean write file into hard drive with a file name?

Look at the following sample, I am not sure whether this is what you
want.

HANDLE hFile;
DWORD wmWritten;
char strData[] = "Test data written to explain the win32 file sample";
hFile = CreateFile("C:\\test.txt",GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
WriteFile(hFile,strData,(DWORD)(sizeof(strData)),&wmWritten,NULL);
CloseHandle(hFile);

PS: I don't think this is an off topic thread.

it's off-topic on comp.lang.c as it necessiates the use of non-
standard
extensions to the C language.
 
§

§ñühw¤£f

Nick Keighley <[email protected]> pinched out a steaming
pile of<8b241b6e-ce61-44b8-867a-
(e-mail address removed)>:
Does anybody know what are the names of the Win32 system calls for direct
reading and writing of disk sectors, rather than the NTFS
routines?

Do you mean write file into hard drive with a file name?

Look at the following sample, I am not sure whether this is what you
want.

HANDLE hFile;
DWORD wmWritten;
char strData[] = "Test data written to explain the win32 file sample";
hFile = CreateFile("C:\\test.txt",GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
WriteFile(hFile,strData,(DWORD)(sizeof(strData)),&wmWritten,NULL);
CloseHandle(hFile);

PS: I don't think this is an off topic thread.

it's off-topic on comp.lang.c as it necessiates the use of non-
standard
extensions to the C language.
But those are the *sexy* wons...Mmmmmm...."non-standard extensions"...

Uhhhhhhhh...

<eyes roll back in head>

--
cageprisoners.com|www.snuhwolf.9f.com|www.eyeonpalin.org
_____ ____ ____ __ /\_/\ __ _ ______ _____
/ __/ |/ / / / / // // . . \\ \ |\ | / __ \ \ \ __\
_\ \/ / /_/ / _ / \ / \ \| \| \ \_\ \ \__\ _\
/___/_/|_/\____/_//_/ \_@_/ \__|\__|\____/\____\_\
 
N

Nobody

Does anybody know what are the names of the Win32 system calls for direct
reading and writing of disk sectors, rather than the NTFS routines?

Do you mean write file into hard drive with a file name?

Look at the following sample, I am not sure whether this is what you
want.

HANDLE hFile;
DWORD wmWritten;
char strData[] = "Test data written to explain the win32 file sample";
hFile = CreateFile("C:\\test.txt",GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
WriteFile(hFile,strData,(DWORD)(sizeof(strData)),&wmWritten,NULL);
CloseHandle(hFile);

PS: I don't think this is an off topic thread.

it's off-topic on comp.lang.c as it necessiates the use of non-
standard extensions to the C language.

I see no language extensions here. Library functions beyond those in the
standard library are a different matter. Most C programs use external
libraries; that doesn't make them "not C".

However, I'd agree that this is off-topic here (meaining comp.lang.c), as
it's *solely* about a particular OS API.
 
R

Robert Maas, http://tinyurl.com/uh3t

From: "Tech07 said:
(SHHHHHhhhhhhh! The "topicality" debaters will hear you and it
will be WWIII again.)

Any such worries are moot, because the end of world is already
scheduled for Thursday night or Friday morning. If you don't
believe me, in the San Francisco bay area, tune to channel 11-2 (on
RF channel 12-2), where the NBC Weather channel shows the five-day
forecast ending Thursday. There won't be any Friday or Saturday
etc. The world will already have ended then.

P.S. Does anybody know the *real* reason why the NBC Weather
channel is showing that weirdness? Did everyone at NOAA go on
strike four days ago, so there are no updated 5-day forecasts since
then, and NBC is simply showing the last info they had before the
strike, which now is the one remaining day from the very old 5-day
forecast they had before the strike?

By the way, yesterday it showed only two days, Wed and Thu, with
three blank spots, so at least it's consistent in showing EOW Thu/Fri.
 
D

Daniel Pitts

Robert said:
Any such worries are moot, because the end of world is already
scheduled for Thursday night or Friday morning. If you don't
believe me, in the San Francisco bay area, tune to channel 11-2 (on
RF channel 12-2), where the NBC Weather channel shows the five-day
forecast ending Thursday. There won't be any Friday or Saturday
etc. The world will already have ended then.

P.S. Does anybody know the *real* reason why the NBC Weather
channel is showing that weirdness? Did everyone at NOAA go on
strike four days ago, so there are no updated 5-day forecasts since
then, and NBC is simply showing the last info they had before the
strike, which now is the one remaining day from the very old 5-day
forecast they had before the strike?

By the way, yesterday it showed only two days, Wed and Thu, with
three blank spots, so at least it's consistent in showing EOW Thu/Fri.
I suspect they didn't bother, because the bridge is going to be closed
off all weekend, starting Friday.

Whether people would stop caring about weather is questionable.
 
P

Pennywise

(e-mail address removed) (Robert Maas, http://tinyurl.com/uh3t)
wrote:
Any such worries are moot, because the end of world is already
scheduled for Thursday night or Friday morning. If you don't
believe me, in the San Francisco bay area, tune to channel 11-2 (on
RF channel 12-2), where the NBC Weather channel shows the five-day
forecast ending Thursday. There won't be any Friday or Saturday
etc. The world will already have ended then.

A month or two ago There was a 96% chance of a major earth quake in
the San Francisco bay area, on the following Friday.

I can't find the link I sent it email to someone and can't find which
message has the link.
 
N

Nick Keighley

Look at the following sample, I am not sure whether this is what you
want.
HANDLE hFile;
DWORD wmWritten;
char strData[] = "Test data written to explain the win32 file sample";
hFile = CreateFile("C:\\test.txt",GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
WriteFile(hFile,strData,(DWORD)(sizeof(strData)),&wmWritten,NULL);
CloseHandle(hFile);
PS: I don't think this is an off topic thread.
it's off-topic on comp.lang.c as it necessiates the use of non-
standard extensions to the C language.
I see no language extensions here. Library functions beyond those in the
standard library are a different matter.

I think the language/library distinction is pretty arbitary.
CreateFile() isn't mentioned in the ISO Standard in either
the language or library section.
Most C programs use external libraries;
yes

that doesn't make them "not C".

I never saif that
However, I'd agree that this is off-topic here (meaining comp.lang.c),
yes

as it's *solely* about a particular OS API

I don't see why this makes a difference. Off-topic is off-topic
 
H

Herbert Rosenau

Does anybody know what are the names of the Win32 system calls for direct
reading and writing of disk sectors, rather than the NTFS routines?

Do you mean write file into hard drive with a file name?

Look at the following sample, I am not sure whether this is what you
want.

HANDLE hFile;
DWORD wmWritten;
char strData[] = "Test data written to explain the win32 file sample";
hFile = CreateFile("C:\\test.txt",GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
WriteFile(hFile,strData,(DWORD)(sizeof(strData)),&wmWritten,NULL);
CloseHandle(hFile);

PS: I don't think this is an off topic thread.

it's off-topic on comp.lang.c as it necessiates the use of non-
standard extensions to the C language.

I see no language extensions here. Library functions beyond those in the
standard library are a different matter. Most C programs use external
libraries; that doesn't make them "not C".

C is defined by the standard. But where in the standard are thes
undefined things are defined? None of my compilesers can find them

HANDLE
DWORD
hFile
CreateFile
WriteFile
CloseFile

All these are clearly not C. They may be used in some properitary
extensions but nowhere in C nor in any documentation related to my OS
is one of them defined, so clearly that all is not C.



--
Tschau/Bye
Herbert

Visit http://www.ecomstation.de the home of german eComStation
eComStation 1.2R Deutsch ist da!
 
N

Nobody

C is defined by the standard. But where in the standard are thes
undefined things are defined? None of my compilesers can find them

HANDLE
DWORD
hFile
CreateFile
WriteFile
CloseFile

All these are clearly not C. They may be used in some properitary
extensions

User-defined types and functions are not "extensions".
but nowhere in C nor in any documentation related to my OS
is one of them defined, so clearly that all is not C.

Not so.

C programs which use functions and types beyond those defined by the
standard are still C programs.

Maybe you are mistaking this group for comp.std.c?
 
K

Keith Thompson

Nobody said:
User-defined types and functions are not "extensions".

C99 4p6:

A conforming implementation may have extensions (including
additional library functions), provided they do not alter the
behavior of any strictly conforming program.
Not so.

C programs which use functions and types beyond those defined by the
standard are still C programs.

Maybe you are mistaking this group for comp.std.c?

No, comp.std.c and comp.lang.c discuss the same language.
 
H

Herbert Rosenau

User-defined types and functions are not "extensions".

None of the above are defined by a user but by an implementation - and
that is known as an properitary extension that is not on topic to clc.
Not so.

C programs which use functions and types beyond those defined by the
standard are still C programs.

Maybe you are mistaking this group for comp.std.c?


--
Tschau/Bye
Herbert

Visit http://www.ecomstation.de the home of german eComStation
eComStation 1.2R Deutsch ist da!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top