Commit graph

55 commits

Author SHA1 Message Date
Serge Gautherie 889b077b23
[REACTOS] *.spec: Fix some function/parameter types (#3154) 2020-09-20 19:21:11 +02:00
Amine Khaldi 139a3d6661
[CMAKE] Implement PCH builds with target_precompile_headers. CORE-16905 2020-06-06 21:58:41 +03:00
Timo Kreuzer dd7fb63cd1 [ADVAPI32] Convert ordinals to @ in spec file 2020-05-24 08:22:24 +02:00
Serge Gautherie 9634a31589
[ADVAPI32] Remove now-redundant comment (#2735)
Addendum to 5dfe345.
2020-05-05 11:37:09 +03:00
Kyle Katarn 5dfe3455db
[ADVAPI32] Fix undue debug print in nominal case (#2734)
In current implementation, when regedit opens HKCR root key, an error is logged
err:(dll/win32/advapi32/reg/hkcr.c:964) Returning 259.
This is not correct as the code 259 is ERROR_NO_MORE_ITEMS which is the nominal return value when end of enumeration is reached.
2020-05-04 23:30:36 +03:00
Serge Gautherie 5542dd50d6
[ADVAPI32] wine/crypt.*: Misc fixes
Import
62df03af96
8b9e3dae4f
2df16753f0

And use explicit '#ifndef __REACTOS__'.
2020-03-28 20:43:04 +01:00
Serge Gautherie 8ae8083378
[ADVAPI32][PSDK] CryptReleaseContext(): dwFlags parameter is DWORD, only
Import
9cc8b501ee
2020-03-28 20:43:03 +01:00
Serge Gautherie df224cb710
[ADVAPI32] wine: Remove remnant ros_diff.patch
Added on 4234345b03 (r48090),
merged on d4a89f6cca.

CORE-14434
2020-03-28 20:43:03 +01:00
Eric Kohl 5d3fe05505 [ADVAPI32] OpenSCManagerA/W: Set the last error even in case of success
This fixes a failure in the QueryServiceConfig2 api test.
2019-12-31 23:23:23 +01:00
Eric Kohl 0625eb3746 [SERVICES][ADVAPI32] Support the security process aka lsass.exe
- Reserve the pipe NtControlPipe0 for the security process.
- Count regular service control pipes from 1.
- Use I_ScIsSecurityProcess to identify the security process.
- Services.exe uses the SECURITY_SERVICES_STARTED event to notify the security process that NtControlPipe0 is ready for use.
2019-08-31 17:24:47 +02:00
Michael Maltsev a303932803
[ADVAPI32] Avoid excessive allocation in CheckTokenMembership. CORE-16094 2019-07-21 11:39:30 +02:00
Timo Kreuzer f3a9b524f1 [ADVAPI32] Fix copying the TokenSource string
TOKEN_SOURCE::SourceString is an 8 char non-null-terminated string. Copy it as such.

Fixes GCC 8 warning:
dll/win32/advapi32/misc/logon.c:638:5: error: 'strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Werror=stringop-truncation]
     strncpy(TokenSource.SourceName, "Advapi  ", sizeof(TokenSource.SourceName));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-07-20 13:56:18 +02:00
Serge Gautherie 46259092f9 [ADVAPI32:REG] Remove some useless casts (#1614) 2019-06-05 18:37:07 +02:00
Serge Gautherie 38db074491 Misc addendum to CORE-14271 (#1529)
* [ADVAPI32] Simplify RtlCreateUnicodeStringFromAsciiz() return value check

RtlCreateUnicodeStringFromAsciiz() returns a BOOLEAN, not a BOOL.

No functional change.

Addendum to
CORE-14271

* [USER32] Simplify RtlCreateUnicodeStringFromAsciiz() return value check

RtlCreateUnicodeStringFromAsciiz() returns a BOOLEAN, not a UINT.

Also, add a FIXME.

No functional change.

Addendum to
CORE-14271

* [USER32] Simplify RegisterClipboardFormatA/W() a bit

No functional change.

* [UDFS] Simplify SeSinglePrivilegeCheck() return value check

No functional change.

Addendum to
CORE-14271
2019-06-04 16:56:33 +02:00
Hervé Poussineau 10ecbaddd0 [ADVAPI32] Send correct type to ElfrChangeNotify()
This fixes the following compiler error:
../dll/win32/advapi32/service/eventlog.c:658:59: error: passing argument 3 of 'ElfrChangeNotify' makes integer from pointer without a cast [-Werror=int-conversion]
dll/win32/advapi32/eventlogrpc_c.h:391:20: note: expected 'ULONG {aka long unsigned int}' but argument is of type 'HANDLE {aka void *}'
2019-04-07 18:32:29 +02:00
Jérôme Gardou 23373acbb9 [CMAKE] Use modules instead of shared libraries
There is no need to compile our DLLs as shared libraries since we are
managing symbols exports and imports through spec files.

On my system, this reduces the configure-time by a factor of two.
2019-04-06 17:43:38 +02:00
Timo Kreuzer f5f6ea2965 [REACTOS] Fix 64 bit issues 2019-03-04 21:58:42 +01:00
Pierre Schweitzer 29b46995aa
[ADVAPI32] When starting or sending a control to a service, set the tag in the TEB
This now allows tracking the threads of the services thanks to their tag.

This fixes the failing test in advapi32:ServiceEnv
2018-12-30 21:44:39 +01:00
Pierre Schweitzer 446e13745c
[ADVAPI32] Stop pretending our advapi32 is NT6+
This is wrong and messes up with internal structures (such as TEB).
For the two needed functions which are "NT6+", they were exported
with NT6, but already existed in W2K3 SP2.

This might fix random bugs

CORE-15526
2018-12-30 21:44:39 +01:00
Pierre Schweitzer e29a99245b
[ADVAPI32] Implement I_ScQueryServiceTagInfo 2018-12-30 14:27:03 +01:00
Pierre Schweitzer 19304da5c3
[ADVAPI32] Implement I_QueryTagInformation 2018-12-30 14:27:02 +01:00
Eric Kohl b17e8a5e3c [ADVAPI32] CreateProcessAsUserA/W: Partially revert an obvious case of over-engineering. Only share the common parts! Now it looks a lot better. No more stupid bUnicode! 2018-12-27 19:29:20 +01:00
Hermès Bélusca-Maïto c446ce0d62
[ADVAPI32] Improve a bit CreateProcessAsUser().
- Check whether the user-provided token is a primary token.

- Do not fail when the RtlAdjustPrivilege() call fails (see the code
  comment for an explanation). TL;DR is: that call may indeed fail but
  the privilege may also not be necessary because the user-provided
  token is a restricted version of the caller's primary token.
  And this is situation is perfectly fine.

This fixes Java 7 installation, CORE-14874.
2018-09-28 00:45:04 +02:00
Hermès Bélusca-Maïto bf164caae8
[SERVICES] Simplify the implementation of RGetServiceDisplayNameA/W() and RGetServiceKeyNameA/W().
Also comment about the observed behaviour of the returned number of "characters"
returned by the ANSI versions of these APIs (which is tested by advapi32_winetest:service).

[ADVAPI32:SCM] Add a comment concerning wide characters vs. bytes mismatch.
2018-09-23 18:09:10 +02:00
Eric Kohl 76588be0d1 [ADVAPI32][SERVICES] Use the session key provided by SystemFunction028 to encrypt and decrypt the service passwords. 2018-09-19 12:30:33 +02:00
Eric Kohl 4114dcad46 [ADVAPI32] Implement SystemFunction028 to always return the default session key. 2018-09-19 00:20:11 +02:00
Eric Kohl e5fcda922b [ADVAPI32][SERVICES] Pass encrypted passwords to the service manager.
- Encrypt passwords before passing them to the service manager. Right now, we are using a fixed encryption key. This will be fixed later.
- Replace the calls to ZeroMemory which are used to wipe the password buffers by calls to SecureZeroMemory.
2018-09-18 21:33:29 +02:00
Eric Kohl 6c0d9c01e2 [ADVAPI32] SystemFunction004 and SystemFunction005 must return the required output buffer size via out->Length when the buffer is too small. 2018-09-17 23:19:02 +02:00
Eric Kohl 5e2c4657ca [ADVAPI32][SERVICES] Add (dummy) password encryption/decryption functions to CreateServiceA/W and ChangeServiceConfigA/W in order to prepare to pass encrypted passwords to the service manager 2018-09-17 16:34:48 +02:00
Getequ d559ca9c98 [ADVAPI32][SHELL32][DESK.CPL] Kill copy-paste of RegLoadMUIString. (#748)
RegLoadMUIStringW/A is part of advapi32.dll . shell32.dll and desk.cpl contained exact line-by-line copy of that function.
2018-08-16 16:10:41 +02:00
Eric Kohl 5ebcc6cdc1 [ADVAPI32] Add parameter checks to LogonUserExW and initialize the token handle. 2018-08-05 16:16:53 +02:00
Eric Kohl bf1e655172 [ADVAPI32] Stop the service dispatcher thread only if a SERVICE_CONTROL_STOP command was sent 2018-07-29 23:40:36 +02:00
Hermès Bélusca-Maïto d4b4da5385
[ADVAPI32] Additions for CreateProcessAsUserA/W().
- Use a common helper function used by both the ANSI and UNICODE functions
  so that the large code block that deals with setting the new process token
  becomes automatically common to both these functions, while the ANSI vs.
  UNICODE conversions are handled directly via the CreateProcessA/W() calls.

- Duplicate the token and acquire the process primary token assignment
  privilege before calling NtSetInformationProcess().
2018-06-27 23:40:07 +02:00
Thomas Faber 95c3e17a80
[ADVAPI32] Fix crash when running advapi32:security with DPH.
Import the following Wine commits:
* 79636bebbfa Michael Müller: advapi32: Set last error to ERROR_SUCCESS in GetSidIdentifierAuthority.
* 1d03ba76116 Hans Leidekker: advapi32: Fix parsing empty DACL/SACL security descriptor strings.
* 5bc2e83c7ab Hans Leidekker: advapi32: Fix size returned from ConvertStringSecurityDescriptorToSecurityDescriptor on 64-bit.
2018-06-10 19:05:26 +02:00
Serge Gautherie 8c312fe7e1 [ADVAPI32] Fix 2 TRACE() format copypastas. 2018-05-03 08:10:43 +02:00
Eric Kohl db60cd219c [ADVAPI32] SEH-protext the calls to service control handlers
ScControlService:
- SEH-protext the calls to service control handlers.
- Return ERROR_EXCEPTION_IN_SERVICE if a service control handler throws an exception.
- Return ERROR_SERVICE_CANNOT_ACCEPT_CTRL if no service control handler has been registered for the service.
2018-05-02 23:24:26 +02:00
Eric Kohl aba6ce5b84 [ADVAPI32] Ignore the return value of the HandlerFunctionEx as well
Ignore the return value of the HandlerFunctionEx because we already ignore the return value of the HandlerFunction.
This fixes a winetest failure.
2018-04-19 06:09:57 +02:00
Amine Khaldi 8da9b8d169 [ADVAPI32] Sync crypt_lmhash.c with Wine Staging 3.3. CORE-14434 2018-04-01 13:18:23 +01:00
Amine Khaldi a3ff25c1d5 [ADVAPI32] Sync crypt_des.c with Wine Staging 3.3. CORE-14434 2018-04-01 13:17:45 +01:00
Amine Khaldi d4a89f6cca [ADVAPI32] Sync crypt.c with Wine Staging 3.3. CORE-14434 2018-04-01 13:17:00 +01:00
Amine Khaldi abc90fa5a6 [ADVAPI32] Sync cred.c with Wine Staging 3.3. CORE-14434 2018-04-01 13:16:11 +01:00
Eric Kohl 94435b53d7 [ADVAPI32] Revert unnecessary changes, clarify comments and clean-up inconsistencies 2018-03-25 12:03:07 +02:00
Eric Kohl 32bb592e12 [ADVAPI32] Improve remaining TRACE messages in service manager functions 2018-03-25 11:30:10 +02:00
Eric Kohl d7e2b7a8e0 [ADVAPI32] Add or improve TRACE messages in a lot of service manager functions 2018-03-25 03:58:53 +02:00
Eric Kohl 51bbab834c [ADVAPI32] Add or improve TRACE messages in the service manager functions 2018-03-25 03:20:34 +02:00
Hermès Bélusca-Maïto 295ea36f9e
[ADVAPI32] Few improvements for Services.
- Set some last errors.
- Fix error code returned by ScLookupServiceByServiceName().
- Check the validity of the handler proc in RegisterServiceCtrlHandler(Ex)W().
- Improve some traces; comment some code.
2018-02-26 00:37:09 +01:00
Hermès Bélusca-Maïto 2e3f80f940
[ADVAPI32] Code formatting + improve two traces. 2018-02-26 00:37:05 +01:00
Hermès Bélusca-Maïto 0c44925ec1
[ADVAPI32] ScStartService(): Just start the thread straight ahead, and return a suitable error code if thread creation failed. 2018-02-26 00:37:01 +01:00
Hermès Bélusca-Maïto 91b50f9ccb
[ADVAPI32] Take into account the service handler context when dispatching a control notification to a service. (Used e.g. by tcpsvcs.) 2018-02-26 00:36:57 +01:00
Hermès Bélusca-Maïto 635aabb011
[ADVAPI32] Use RPC types where needed. Comments cleanup. 2018-02-26 00:36:53 +01:00