Time/Date Control Panel doesn't save time zone across boots

M

Mark K Vallevand

I've added the Date/Time Control Panel and the applet works fine, but when I
reboot, the time zone is set back to GMT. As long as I never reboot, the
time zone is OK. The applet shows it correct. But, the registry
information at HKLM\System\CurrentControlSet\Control\TimeZoneInformation is
never updated.

What am I missing?
 
M

Mark K Vallevand

I have EWF in the image, but not enabled yet.

I don't enable it until FBA is done, and after a couple of sessions to setup
things and install some applications. In fact, one of the two embedded
releases I make runs with it disabled all the time.

It behaves the same if EWF is disabled or enabled.
 
M

Mark K Vallevand

I have EWF in the image, but not enabled yet.

I don't enable it until FBA is done, and after a couple of sessions to setup
things and install some applications. In fact, one of the two embedded
releases I make runs with it disabled all the time.

It behaves the same if EWF is disabled or enabled.
 
S

Slobodan Brcin

Why again same post?
Have you seen my reply from yesterday?

Regards,
Slobodan
 
M

Mark K Vallevand

My network connection was wonky yesterday. So, some stuff got sent twice.
And, I haven't seen your reply in this newsreader. I just looked in another
reader. To answer your questions.

---
http://www.microsoft.com/windows/embedded/community/tips/xp/timezone.asp
Can you use it?
---
Yes, I've seen it. In fact, I already had this solution in hand. I have a
component that has the registry settings to put the image into the GMT
timezone, which was my requirement. Requirements change, and now I need to
allow the configuration of any timezone.

---
Also check in registry with regedit if value is updated before you reboot.
---
No. The registry is not updated after the date/time control panel app is
used. But, the timezone setting remains correct in the control panel app
until I reboot. The registry never changes in
HKLM\System\CurrentControlSet\Control\TimeZoneInformation. I wonder where
the control panel app keeps the timezone setting?
 
M

Mark K Vallevand

I've got more info...
The date/time conptrol panel app is the same as XP Pro. So there isn't a
different version in XPe.
I can't see anything using regmon. It certainly never updates the registry
with time zone information.

I'm guessing that there is some missing component in my image. Some
security thing?

Does this work for anyone? Can you set the timezone?

I'm getting close to panic mode.
 
D

Doug Hoeffel \(eMVP\)

Mark:

I have no problems with this. I use XPe SP1 with Windows Standard Logon and
Explorer shell and RAM-based EWF. I have the "NLS Time Zone" component plus
the "Date/Time Control Panel" component. I created a custom component to
set the TZ that I want. I modified the build order in this custom component
to 1001 so these registry settings overwrite the "NLS Time Zones" components
registry settings.

I'm not sure that it matters but I have all the "Administrative Support"
Tools, i.e. I allow all dependencies to be pulled in to my image. Are you
ignoring any of the dependencies that TD wants to pull in?

HTH... Doug
 
S

Slobodan Brcin

Hi Mark,

I have tried on Windows XP to change my time zone.
And using regmon I can see 8 different writes to
HKLM\System\CurrentControlSet\Control\TimeZoneInformation.

Try using filemon in your XPE image, maybe you can see something.

I don't need to set timezone, also I don't have control panel.


Best regards,
Slobodan
 
M

Mark K Vallevand

I've done exactly what you did, except my custom TZ component is build order
1000. It should be 1001, and I'm going to try that. I've also tried
leaving out my custom TZ component, so the "NLS Time Zones" registry
settings are used. But, now I see that these two tests are the same.

I don't have any unresolved dependancies.

Maybe you do need the custom TZ component to override "NLS Time Zones"
registry settings for the Date/Time Control Panel to work.

That's the path I'm going to follow.
 
M

Mark K Vallevand

Nope. Still don't work. I've made certain the TZ registry settings are
correct. They match my XP Pro machine. Registry is never updated with new
TZ. But, the control panel app remembers the new TZ even though the
registry is not updated. It must save the information in some other place.

Some one in MS must be able to take a quick look at the code. Why wouldn't
the date/time control panel app try to update the registry?
 
S

Slobodan Brcin

I looked at the logs, but I don't know why XPE won't call SetValue.

I don't think that missing dependency would manifest itself like this since
XPE queries all keys from registry like XP, only don't want to write them.

You should try to see with Doug, what he had done.

Best regards,
Slobodan
 
D

Doug Hoeffel \(eMVP\)

Mark:

Well, I'm not sure what is going on here.

I ran a test on my system with the EWF disabled just to make things easier.
I changed the TZ via Date/Time CP applet, and the setting sticks after a
reboot. I do see the key
HKLM\System\CurrentControlSet\Control\TimeZoneInformation change correctly.
I would assume that the Date/Time CP applet calls the SetTimeZoneInformation
API. I also call this API with the correct tzi structure when I change the
date, time, or TZ via my ASP-based web application.

I'm not sure if it matters, but check the permissions on the
HKLM\System\CurrentControlSet\Control\TimeZoneInformation key. Do you have
full control? Are you logged on as an Administrator?

HTH... Doug
 
M

Mark K Vallevand

Yes, I have correct permissions on the key.
Yes, I am Administrator.

Could I be missing the SetTimeZoneInformation API? Is it in a DLL, or
where? Do I need a certain component? My docs say its in kernel32.lib.

Maybe I'll write a little test program to use SetTimeZoneInformation().
 
M

Mark K Vallevand

I've written a simple little program.

#include "windows.h"
#include "stdio.h"

void main()
{
TIME_ZONE_INFORMATION tz;

DWORD r = ::GetTimeZoneInformation( &tz );
printf( "GetTimeZoneInformation 0x%x\n", r );
switch ( r )
{
case TIME_ZONE_ID_UNKNOWN:
case TIME_ZONE_ID_STANDARD:
case TIME_ZONE_ID_DAYLIGHT:
{
BOOL b = ::SetTimeZoneInformation( &tz );
printf( "SetTimeZoneInformation %d\n", b );
if ( b == 0 ) printf( "LastError 0x%x\n", ::GetLastError() );
}
break;
default:
printf( "LastError 0x%x\n", ::GetLastError() );
break;
}
}

On my XP Pro machine, it works fine, and regmon shows the updates.

On two different XPe machines with different hardware and different images,
it also works fine, but regmon *does not* show the updates.

It looks like its inside of the API, whereever that is implemented.
SetTimeZoneInformation returns a good status. I'm assuming it works fine
for the Date/Time Control Panel app, too. Somehow the registry update is
bypassed.
 
S

Slobodan Brcin

Strange,

Try using reg, or regedit, to see if you can make change to these entries.

Slobodan
 
M

Mark K Vallevand

Yes, I can update the registry settings. I can change the TZ by first
changing it on my XP machine, exporting the registry key, and then importing
the key into the XPe registry.
 
S

Slobodan Brcin

Hi Mark,

If you don't find any other solution to make it work.

Then create different reg files for all needed time zones.

And use reg.exe from bat file to import them to registry.

Regards,
Slobodan
 

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