what method does xpepm use?

T

Tony Pitman

I have an applet that I want to shut down windows. I use the ExitWindowsEx
with the poweroff and force flags. It takes about 10 seconds to shut down.

On the other hand the xpepm.exe - shutdown method shuts down in about 2
seconds. Does anyone have the source code to xpepm.exe or the dll or know
what function it calls to force such a quick shutdown?

Tony
 
S

Sean Liming \(eMVP\)

Tony,

There is a XPEPM API set found on XPe CD 1. I believe the .H and .LIB files
are in the extras folder. I have built a couple of applications from the
XPEPM API.

Regards,

Sean Liming
XP Embedded Manager
A7 Engineering (www.a7eng.com)
Author: Windows XP Embedded Advanced and Windows NT Embedded Step-by-Step
 
T

Tony Pitman

Sean,

Thanks for the quick reply. Actually I am curious what system API call the
xpepm application itself uses to do the dirty work. I would rather not have
to include xpepm.exe or xpepm.dll in my project if I can help it.

I would also like to understand the difference between the way xpepm does it
and the ExitWindowsEx API call.

Tony
 
T

Tony Pitman

Sean,

This may be a stupid question, but where do I download XPe CD1? I have
Universal MSDN, but can't seem to find that download.

Tony
 
S

Sean Liming \(eMVP\)

Tony,

Are you using XP Embedded? XPEPM.H and .LIB are on the first CD that comes
with XP Embedded.

Regards,

Sean
 
S

Sean Liming \(eMVP\)

Tony,

I don't know. This would be an MS questions.

Regards,

Sean Liming
XP Embedded Manager
A7 Engineering (www.a7eng.com)
Author: Windows XP Embedded Advanced and Windows NT Embedded Step-by-Step
 
T

Tony Pitman

Sean,

Ok, here is where I get a little confused. I am writing software for a
company that has a Windows XP embedded device. As far as I know I don't need
anything special to do that. I don't have any WXP enbedded CDs. I just have
Windows XP on my desktop and am writing software that I then send to this
company that has the device. I don't think they even have any CDs. I think
they bought the device from some other company that I am sure I cannot get
ahold of.

Soooo, where does this CD come from? I have searched the MS web site and
can't find any place to either download or purchase it.

Tony
 
S

Slobodan Brcin

Tony,
Sorry for jumping in, but if you need it for testing then you can download
evaluation version from MS site.

Are you familiar what XPE is all about.
You will need too much time to make exact build as on your test device.

Best regards,
Slobodan
 
T

Tony Pitman

Slobodan,

Well, because for some reason whatever method xpepm uses is much faster than
ExitWindowsEx. Any idea why?

Tony
 
S

Slobodan Brcin

API is NtShutdownSystem like I said.

In your case it probably terminate some app and services without letting
them shutdown.

In my build ExitWindowsEx shutdown my device in less than a second.
So, I don't have idea why it takes so long for you.


Best regards,
Slobodan
 
T

Tony Pitman

Slobodan,

First, thank you for jumping in. The more help the better :).

Where can I download this evaluation version and what exactly is it? I
thought that developing for XPe was the same as developing for regular XP
except you have to make sure an not use APIs and stuff that don't exist on
the target. That is pretty easy if you just write a straight Win32
application and stick to very basic APIs.

I didn't know that I needed anything special to develop for XPe, so why
would I need to download this evaluation in the first place? Is it because
it contains the xpepm stuff? If that is the case, then I will go download
it.

Isn't there some way to just get the xpepm .h and .lib files from somewhere
by themselves?

Tony
 
T

Tony Pitman

Sloboban,

Ah, I see. The device that we are targetting, I believe, is a new TabletPC
hybrid of some kind. It may have more stuff running on it that ExitWindowsEx
takes the time to shut down. I will check out NtShutdownSystem and see what
happens.

Tony
 
S

Slobodan Brcin

You can always use only what is provided.

In your case probably all API will work.
But it would be possible to make 10 MB image without Win32 subsystem so you
need to know what functionality you have.

If you have fast link then you can download 100 MB+ just for xpepm.h and lib
but you can always use dll directly or write your own.
I don't see need for downloading XPE just for this.

Are you sure that your XPE has EWF (Enhanced Write Filter)? To protect XPE
partition from this fast termination, since this time difference does not
sound healthy to me.


Regards,
Slobodan
 
T

Tony Pitman

Slobodan,

Unless EWF is standard I would guess not. I too share the same concerns that
there could be disk corruption with a fast shutdown like this. I have made
that known to the customer and will let them decide.

Thanks for the heads up on NtShutdownSystem. It works great! And it is fast
just like xpepm is. You are a life saver.

Tony
 
S

Slobodan Brcin

If you are planning to program for XPE, then you should read some info about
it.
Like EWF.
It is standard part of XPE package.

But you should ask if it is included in XPE build that you are writing for.
And know partitions that are protected by it.

If boot partition that holds XPE, is protected by EWF then you can probably
safely reboot device at any time.


Regards,
Slobodan
 
A

Anil Ingle [MS]

NtShutdownSystem - does what it says. Your apps will not recv any chance to
clean up like what ExitWindowsEx gives you with the WM_QUIT message.
-Anil[MS] "This posting is provided AS IS. It makes no warranties and
confers no rights."
 

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

Top