Click here to Skip to main content
11,636,300 members (75,521 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WinXP Embedded C++ Device
Hey,

Im working on Windows Embedded and writing in C++.
At the moment I'm writing a program to rename a harddisk from a driver. Im renaming the hard disk right after the first boot of the system.
The program is working fine. After the program is finished it has to reboot my computer.

But here is the problem:

The program has to check whether my system settings has changed or not.
If they changed, i have to wait, until the Dialog "Systems Settings Changed" poped up and restart.
Otherwise,I don't have to wait.

By now i found out, that windows is using the newdev.dll for installing devices.

Can i check somehow if the newdev.dll is in use?

I tried it with CreateFile() with READ and WRITE.
HANDLE hwnd;
hwnd=CreateFile(L"C:\\Windows\\System32\\newdev.dll",GENERIC_WRITE,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
std::cout << GetLastError();
In addtion I tried to load it with LoadLibrary. But that failed too.
HMODULE hwnd;
 
hwnd= LoadLibrary("C:\\Windows\\System32\\newdev.dll");
IF(hwnd == NULL)
{
   printf("In Use");
}

I hope you can help me.

Regards
Chris
Posted 22-Aug-13 3:10am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Fetch all hard disk data before the change event and compare it to the fetched data after your change. If something is changed youre done...
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 jyo.net 263
1 Sergey Alexandrovich Kryukov 254
2 stibee 249
3 Suvendu Shekhar Giri 225
4 OriginalGriff 183
0 OriginalGriff 8,941
1 Sergey Alexandrovich Kryukov 8,459
2 Mika Wendelius 6,849
3 F-ES Sitecore 2,364
4 Suvendu Shekhar Giri 2,320


Advertise | Privacy | Mobile
Web01 | 2.8.150728.1 | Last Updated 26 Aug 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100