6 Win32 function stubs, 8 constants, 1 structure, and 1 helper function#535
6 Win32 function stubs, 8 constants, 1 structure, and 1 helper function#535mlfreeman2 wants to merge 9 commits intojava-native-access:masterfrom mlfreeman2:master
Conversation
* Added LOGON_WITH_PROFILE constant * Added LOGON_NETCREDENTIALS_ONLY constant * Added CreateProcessWithLogonW(String, String, String, int, String, String, int, Pointer, String, STARTUPINFO, PROCESS_INFORMATION) * No Unit Test - I would have to make it create a user to be 100% able to run a process as another user and that would be a security issue I figure. * Crypt32 * Added CertAddEncodedCertificateToSystemStore(String, Pointer, DWORD) * No Unit Test - I doubt anyone would want the security risk of a unit test installing a root certificate. * GDI32 * Added SRCCOPY constant * Added BitBlt(HDC, int, int, int, int, HDC, int, int, int) * No direct unit test - the test for GDI32Util.getScreenshot() seemed to cover it just fine. * Added GDI32Util.getScreenshot(HWND) * Added unit test as GDI32UtilTest.testGetScreenshot() * Shell32 * Added SHERB_NOCONFIRMATION constant * Added SHERB_NOPROGRESSUI constant * Added SHERB_NOSOUND constant * Added SEE_MASK_NOCLOSEPROCESS constant * Added SHEmptyRecycleBin(HANDLE, String, int) * No unit test - no idea how to tell if the recycle bin is empty afterwards * Added ShellExecuteEx(SHELLEXECUTEINFO) * No unit test - there are a bunch of cases where the hProcess member in SHELLEXECUTEINFO isn't set - not sure how to control for that * ShellAPI * Added SHELLEXECUTEINFO structure * User32 * Added GetDesktopWindow() * Added test as User32Test.testGetDesktopWindow() * WinGDI * Added HGDI_ERROR * Removed superfluous "public" and "public final" from WinGDI
|
I did try to incorporate all the feedback that @lgoldstein and @dblock gave me on the last (now closed) pull request. |
|
Added negative unit tests for CreateProcessWithLogonW and CertAddEncodedCertificateToSystemStore I figure those will be secure since they're meant to fail with specific windows error codes. |
|
Got creative and managed to figure out what I think might be reasonable negative tests for the remaining functions in this PR. |
There was a problem hiding this comment.
You can usually safely use int instead of DWORD here (as well as for return values). I agree that DWORD and int are not entirely equivalent, but for most purposes the sign is not important - e.g., error codes or sizes (as in this case).
There was a problem hiding this comment.
Reverse the order of the arguments to assertEquals - the expected comes first (in this case W32Errors.ERROR_LOGON_FAILURE should be first and getLastError() second).
Hopefully this is more manageable and more acceptable than my last way-too-large pull request