Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / September 2004

Tip: Looking for answers? Try searching our database.

How to make the Windows to run a console program during OS startup?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ZhangZQ - 14 Sep 2004 07:57 GMT
How to make the Windows to run a console program during OS startup, like the
Chkdsk program to do when the OS does not shutdown properly? Now I want to
run my program instead of Chkdsk during the OS startup, is there a way to do
that?

Thank you very much!

Regards,
ZhangZQ
Don Burn - 13 Sep 2004 17:19 GMT
You cannot do it instead of Chkdisk, but you can use a native API program in
addition to ChkDisk, see http://www.sysinternals.com/ntw2k/info/native.shtml
.  Note this does not use the Win32 API so you are going to have to write a
custom application for this, and be aware that much of this API is
officially undocumented and subject to change.

Signature

Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply

> How to make the Windows to run a console program during OS startup, like the
> Chkdsk program to do when the OS does not shutdown properly? Now I want to
[quoted text clipped - 5 lines]
> Regards,
> ZhangZQ
ZhangZQ - 14 Sep 2004 15:46 GMT
Don Burn,

That is the very useful information for me, thank you very very much!

Regards,
ZhangZQ

> You cannot do it instead of Chkdisk, but you can use a native API program
> in
[quoted text clipped - 17 lines]
>> Regards,
>> ZhangZQ
ZhangZQ - 14 Sep 2004 19:02 GMT
Don Burn,

I tried that program and it can display "hello world" in the blue screen,
very good! I haven't installed the DDK now so I still can't compile that
program, I have a question now, is it possible to call the Win32 API
CreateFile, ReadFile, WriteFile in that program?

Regards,
ZhangZQ

> You cannot do it instead of Chkdisk, but you can use a native API program
> in
[quoted text clipped - 17 lines]
>> Regards,
>> ZhangZQ
ZhangZQ - 14 Sep 2004 21:02 GMT
Oh, I think CreateFile, ReadFile, WriteFile must can't be called at that
time, and I found there is a NtOpenFile in NTDLL.dll, but can't find the
definition of that function so I disassembled that function and found it
call IoCreateFile, Ok, there are 2 solution now, but I don't know if it is
feasible,

1. Replace all the IO function that use the Win32 API with the DDK IO
function.
2. I also found LdrLoadDll in NTDLL.dll, is it possible to load the module
that implement the CreateFile, then there is no need to modify my existing
program.

What is your suggestion? Thank you very much!

Regards,
ZhangZQ

> Don Burn,
>
[quoted text clipped - 28 lines]
>>> Regards,
>>> ZhangZQ
Jonathan Wilson - 14 Sep 2004 06:09 GMT
If there is a Ntxxxx function documented in the windows DDK (or MSDN), the
prototype will be the same in ntdll.dll as in ntoskrnl.exe. This is because
ntdll.dll ntxxx functions all call through to the same functions in
ntoskrnl.exe.
Jonathan Wilson - 14 Sep 2004 06:13 GMT
check here
http://undocumented.ntinternals.net/
for documenation on the ntdll.dll functions you want to use.
ZhangZQ - 14 Sep 2004 06:43 GMT
Wah!!  GREAT!!!  Thank you very much!

Regards,
ZhangZQ

> check here
> http://undocumented.ntinternals.net/
> for documenation on the ntdll.dll functions you want to use.
CheckAbdoul - 14 Sep 2004 14:30 GMT
   There should be a equivalent call to NtOpenFile named as ZwOpenFile() in
ntdll.dll. Native applications generally can call only API's from ntdll.dll
and can also send IOCTL's to drivers to get things done.

Signature

Cheers
Check Abdoul [VC++ MVP]
-----------------------------------

> Oh, I think CreateFile, ReadFile, WriteFile must can't be called at that
> time, and I found there is a NtOpenFile in NTDLL.dll, but can't find the
[quoted text clipped - 45 lines]
> >>> Regards,
> >>> ZhangZQ

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.