I stuck upon this function right now. And I see ReactOS folks already have some implementation [*], but for some reason it is disabled.
Is anyone working on this for Wine? Any ideas about the ReactOS code?
[*] http://www.reactos.org/generated/doxygen/d4/d55/lib_2setupapi_2stubs_8c-sour...
On 1/27/06, Saulius Krasuckas saulius2@ar.fi.lt wrote:
I stuck upon this function right now. And I see ReactOS folks already have some implementation [*], but for some reason it is disabled.
Is anyone working on this for Wine? Any ideas about the ReactOS code?
Start off by reading through the msdn documentation of the function:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/setupapi/se...
Read through it thoroughly and make note of all the details of the function. Then write as many test cases as you can for the function. Test the details you found on msdn and any other cases you can think of. This should give you a better idea of how to implement the function because you'll understand what needs to happen for each particular case.
-- James Hawkins
* On Fri, 27 Jan 2006, James Hawkins wrote:
- On 1/27/06, Saulius Krasuckas saulius2@ar.fi.lt wrote:
Is anyone working on this for Wine? Any ideas about the ReactOS code?
Read through it thoroughly and make note of all the details of the function. Then write as many test cases as you can for the function. Test the details you found on msdn and any other cases you can think of. This should give you a better idea of how to implement the function because you'll understand what needs to happen for each particular case.
James, I wasn't asking about how should I hack on unimplemented function. My interest is focused on work of another guys, which is done already. :)
BTW, how would you ensure that the testing of this function succeeds if you pass the flag to it which reboots the machine and probably kills the test-process? ;-)
On 1/27/06, Saulius Krasuckas saulius2@ar.fi.lt wrote:
- On Fri, 27 Jan 2006, James Hawkins wrote:
- On 1/27/06, Saulius Krasuckas saulius2@ar.fi.lt wrote:
Is anyone working on this for Wine? Any ideas about the ReactOS code?
Read through it thoroughly and make note of all the details of the function. Then write as many test cases as you can for the function. Test the details you found on msdn and any other cases you can think of. This should give you a better idea of how to implement the function because you'll understand what needs to happen for each particular case.
James, I wasn't asking about how should I hack on unimplemented function. My interest is focused on work of another guys, which is done already. :)
I based the assumption on your statement, "I stuck upon this function right now." You said you were stuck, so I offered suggestions on how to move forward. I looked at the ReactOS implementation and saw that it was #ifdefined out, so I also assumed that wasn't code we should be porting back to Wine. Steven's comments verify this.
BTW, how would you ensure that the testing of this function succeeds if you pass the flag to it which reboots the machine and probably kills the test-process? ;-)
I was suggesting you write tests for your own testing, not adding unit tests to Wine's test suite, though that's always good. To answer your original question, msdn states that the third parameter of SetupPromptReboot, ScanOnly, is a BOOL that determines whether the user is asked to reboot or not. If ScanOnly is TRUE, the user is not prompted to reboot, and no shutdown occurrs. msdn also says this about ScanOnly:
"Use ScanOnly to determine if shutdown is necessary separately from actually initiating a shutdown."
You can tests invalid parameters, using a valid FileQueue, see what values are returned etc.
You won't be able to test a successful reboot in Wine's test suite, but you can test it with your personal tests. Besides that, you can set ScanOnly to TRUE and you get all the results you would get if the machine were to reboot without actually rebooting the machine.
-- James Hawkins
* On Fri, 27 Jan 2006, James Hawkins wrote:
- On 1/27/06, Saulius Krasuckas saulius2@ar.fi.lt wrote:
James, I wasn't asking about how should I hack on unimplemented function. My interest is focused on work of another guys, which is done already. :)
I based the assumption on your statement, "I stuck upon this function right now."
Yeah, I mean my debugging process has been halted due to a stubbiness (not due to lack of devel-instructions).
You said you were stuck, so I offered suggestions on how to move forward.
OK, next time I will declare I have read the Wine Developers Guide and have been following wine-devel list for a two years already. ;-)
I looked at the ReactOS implementation and saw that it was #ifdefined out, so I also assumed that wasn't code we should be porting back to Wine. Steven's comments verify this.
Do they? Steven talks about ReactOS, not about Wine. I think Wines ExitWindowsEx() is doing fine for Wine needs. Then we can simply remove #if 0 and be fine. No?
BTW, how would you ensure that the testing of this function succeeds if you pass the flag to it which reboots the machine and probably kills the test-process? ;-)
I was suggesting you write tests for your own testing, not adding unit tests to Wine's test suite,
OK, now I get you, thanks. :)
You won't be able to test a successful reboot in Wine's test suite, but you can test it with your personal tests.
I think we still should able to test the reboot, only that this requires new functionality to be added to winetest*.exe application: winetest should be able to interrupt its execution, then it should resume it after the reboot. IMHO that's not impossible.
On 1/28/06, Saulius Krasuckas saulius2@ar.fi.lt wrote:
I looked at the ReactOS implementation and saw that it was #ifdefined out, so I also assumed that wasn't code we should be porting back to Wine. Steven's comments verify this.
Do they? Steven talks about ReactOS, not about Wine.
If you really want to know if it's OK to copy it from ReactOS into Wine, ask Steven specifically. Otherwise you can try it out and see if it works.
Then we can simply remove #if 0 and be fine. No?
No, you'd have to add the string resources for the shutdown message. You'd also have to add handling for the FileQueue parameter because it's missing in ReactOS.
I think we still should able to test the reboot, only that this requires new functionality to be added to winetest*.exe application: winetest should be able to interrupt its execution, then it should resume it after the reboot. IMHO that's not impossible.
If there's enough demand for that functionality, then eventually someone would implement it, though in the case of SetupPromptReboot there are enough ways to test the function without rebooting that reboot testing functionality would be extraneous.
A simple way to implement such a feature without having to change the test framework is like so:
1) Add the current test executable to the RunOnce key. 2) Create a test-specific reg value, say DidReboot, that is set to 1 if we reboot. 3) Before calling the function to actually reboot, check the DidReboot value. If it's 1, set it to 0 and skip the reboot call, else set the value to 1 and reboot.
-- James Hawkins
* On Sat, 28 Jan 2006, James Hawkins wrote:
- On 1/28/06, Saulius Krasuckas saulius2@ar.fi.lt wrote:
Then we can simply remove #if 0 and be fine. No?
No, you'd have to add the string resources for the shutdown message. You'd also have to add handling for the FileQueue parameter because it's missing in ReactOS.
Of course, but I was talking about the code, not the data. :) As for FileQueue handling I prefer to leave this case as a stub for a while.
BTW, James, maybe are you were working on this function by yourself already?
On 1/28/06, Saulius Krasuckas saulius2@ar.fi.lt wrote:
Of course, but I was talking about the code, not the data. :) As for FileQueue handling I prefer to leave this case as a stub for a while.
If it makes the case your working on work, then it can be left out till later. Are you working on an app that calls this function?
BTW, James, maybe are you were working on this function by yourself already?
Na, I'm working on SetupGetInfInformation and related query functions as a fix for bug 4355, but after I get these in I'm heading back to advpack.
-- James Hawkins
Hi,
On 1/27/06, Saulius Krasuckas saulius2@ar.fi.lt wrote:
Is anyone working on this for Wine? Any ideas about the ReactOS code?
The shutdown code ExitWindowsEx calls is a complex beast. Its something like 40 steps all of which were not implemented so it was disabled until the rest of the plumbing was put in.
-- Steven Edwards - ReactOS and Wine developer
"There is one thing stronger than all the armies in the world, and that is an idea whose time has come." - Victor Hugo