CORE-10504 #resolve
[APPS]: Use again just the conutils library.
The effect of these two modifications above is to partly revert r73024 (the code splitting remains on the contrary).
[CMAKE]: Remove the "evil workaround" (revert r73027). See CORE-12206 for more details.
svn path=/trunk/; revision=73110
- Introduce new functionalities related to console streams, a console screen management api (almost stubbed), a console pager api (adapted from code from CMD). This new functionality will be used in the future. See CORE-10504 for more details.
- As this library is therefore growing up, split it in small parts (sublibraries) that can be used, with the following dependency scheme: base utils (standalone); streams depending on base; screen depending on streams; pager depending on screen.
[APPS]: As a result, modify the CMakeLists of the different apps that use conutils to make them depend on the correct sublibrary.
svn path=/trunk/; revision=73024
Make those command tools use the console uilities library, aka. solve all those problems of wrong characters on the console...
CORE-10584 #resolve
[CONUTILS]: Remove the now unneeded compatibility defines.
CORE-10504
svn path=/trunk/; revision=72933
- Use Puts functions where needed;
- Fix a __stdcall that needs to be read __cdecl for a variadic function.
[CACLS]
Fix some resources so that the strings can hold on the width of a standard console screen (80 chars).
svn path=/trunk/; revision=72930
Make those command tools use the console uilities library, aka. solve all those problems of wrong characters on the console...
Nitpickers may notice that at some places, the usage of a "Puts"-like function would be better than Printf. Don't worry, I'm on it, it's for another commit.
CORE-10504
CORE-11909 #resolve
svn path=/trunk/; revision=72928
- Use explicit unicode functions where possible.
- Use ARRAYSIZE(foo) instead of sizeof(foo)/sizeof(foo[0]).
- Don't hardcode some buffer sizes.
- Try reducing level of code indentation in some functions.
- Make StartShell and StartInstaller return a boolean (TRUE: success; FALSE: failure). Will be needed in the next commit.
- Remove a useless "#pragma warning".
svn path=/trunk/; revision=72821
- CreateUserEnvironment: if user impersonation fails, just fail the call.
- SetDefaultLanguage: Use the *correct* HKEY_CURRENT_USER key to retrieve the lang., that is, first impersonate the user, then, call RegOpenCurrentUser. We do that because otherwise calling RegOpenKey(Ex) for HKEY_CURRENT_USER just uses the process cached value of HKEY_CURRENT_USER, which does not change *even if* one impersonates an user.
[MSGINA]
- Correctly impersonate the user when opening & initializing the shutdown dialog (in the same way as winlogon does), i.e. call ImpersonateLoggedOnUser and use RegOpenCurrentUser.
- Fill few (but not all) code holes in WlxScreenSaverNotify.
svn path=/trunk/; revision=72737
Concerning the fix in the NDK header I've checked that publicly available information about this structure (NirSoft website, Windows Internals book, Windows symbols...) has the member correctly named.
svn path=/trunk/; revision=72679
- Properly invalidate service handles when closing/freeing them
Dedicated to Hermès and any regression chaser. FalsePositives--
svn path=/trunk/; revision=72396
Check for NULL pointers before derreferecing them in ScmIsSameServiceAccount().
Patch by Victor Martinez Calvo.
CORE-11599 #resolve #comment Thanks a lot!
svn path=/trunk/; revision=71954
Fix yet another MSDN bug: ChangeServiceConfig2 ALWAYS requires SERVICE_CHANGE_CONFIG and SERVICE_START access rights and an enabled SE_SHUTDOWN_PRIVILEGE privilege when you try to set the failure actions. Otherwise, you will just get a STATUS_ACCESS_DENIED.
- Remove the access and privilege checks from ScmSetFailureActions and move them to RChangeServiceConfig2W.
svn path=/trunk/; revision=71814
- Update the resource program description.
- Convert to full UNICODE.
- Use Win32 functions where possible.
- Factor-out the usage of QueryDosDevice into a QuerySubstedDrive function, that returns error codes according to whether the specified drive is a mapped (substed) drive, or is just an existing drive that is not a mapping, or if the drive does not exist. This allows us to detect attempts to use a drive letter that is not a mapped drive, to define a new mapping, and if so we reject such attempt.
This fixes CORE-10681 #resolve #comment Fixed with another patch according to my last remark.
svn path=/trunk/; revision=71695
- Headers reordering.
- Use ARRAYSIZE.
- Give the internal helper function IsSubstedDrive just the single letter of the drive to check for.
- AddSubst and DeleteSubst: both take a drive string of *exactly* two characters: the drive letter and the ':' (and of course there's the NULL terminator): fix the parameter check in this regard.
- AddSubst: It is possible on Windows to use the DefineDosDevice API to map a drive letter to a *file* (yes yes!!) (but the mapping made is unusable). Forbids this case in SUBST since it is not made for that.
CORE-10681
svn path=/trunk/; revision=71693
- Create the absolute default service security descriptor when services.exe starts up.
- Create a self-relative security descriptor whenever it is needed.
svn path=/trunk/; revision=71684
Create an individual security descriptor for each service. We cannot use a common default security descriptor because RtlSetSecurityObject will free the old security descriptor when we try to set a new one.
svn path=/trunk/; revision=71679
Use self-relative security descriptors only:
- Convert the default service security descriptor to the self-relative format.
- Remove security descriptor format conversions from ScmReadSecurityDescriptor and ScmWriteSecurityDescriptor.
svn path=/trunk/; revision=71676
- Read the service security descriptors when the service list is created.
- Assign and write the default security descriptor when a service does not have its own security desciptor.
- Delete a service security desciptor when the service is deleted.
svn path=/trunk/; revision=71611
- Create a default service security descriptor.
- RCreateServiceW: Assign the default security descriptor to new services on service creation and store it in the registry.
- RQueryServiceObjectSecurity: Return the services security descriptor to the caller.
svn path=/trunk/; revision=71603
- RChangeServiceConfigA/W: Modify or delete password secrets.
[ADVAPI32]
- ChangeServiceConfigA, CreateServiceA: Convert passwords to Unicode before passing them to the remote functions.
svn path=/trunk/; revision=71394
- On service stop, set Service->lpImage to NULL after calling ScmDereferenceServiceImage, so the same image is not dereferenced again on service deletion
- Do not call ScmDereferenceServiceImage in CreateServiceListEntry, as the service should never have an image there
CORE-11273 #resolve
svn path=/trunk/; revision=71355