/* FUNCTIONS ***************************************************************/
-VOID
+NTSTATUS
LsarStartRpcServer(VOID)
{
RPC_STATUS Status;
+ DWORD dwError;
+ HANDLE hEvent;
RtlInitializeCriticalSection(&PolicyHandleTableLock);
if (Status != RPC_S_OK)
{
WARN("RpcServerUseProtseqEpW() failed (Status %lx)\n", Status);
- return;
+ return I_RpcMapWin32Status(Status);
}
Status = RpcServerRegisterIf(lsarpc_v0_0_s_ifspec,
if (Status != RPC_S_OK)
{
WARN("RpcServerRegisterIf() failed (Status %lx)\n", Status);
- return;
+ return I_RpcMapWin32Status(Status);
}
DsSetupInit();
if (Status != RPC_S_OK)
{
WARN("RpcServerListen() failed (Status %lx)\n", Status);
- return;
+ return I_RpcMapWin32Status(Status);
+ }
+
+ /* Notify the service manager */
+ TRACE("Creating notification event!\n");
+ hEvent = CreateEventW(NULL,
+ TRUE,
+ FALSE,
+ L"LSA_RPC_SERVER_ACTIVE");
+ if (hEvent == NULL)
+ {
+ dwError = GetLastError();
+ TRACE("Failed to create or open the notification event (Error %lu)\n", dwError);
+#if 0
+ if (dwError == ERROR_ALREADY_EXISTS)
+ {
+ hEvent = OpenEventW(GENERIC_WRITE,
+ FALSE,
+ L"LSA_RPC_SERVER_ACTIVE");
+ if (hEvent == NULL)
+ {
+ ERR("Could not open the notification event (Error %lu)\n", GetLastError());
+ return STATUS_UNSUCCESSFUL;
+ }
+ }
+#endif
+ return STATUS_UNSUCCESSFUL;
}
+ TRACE("Set notification event!\n");
+ SetEvent(hEvent);
+
+ /* NOTE: Do not close the event handle, as it must remain alive! */
+
TRACE("LsarStartRpcServer() done\n");
+ return STATUS_SUCCESS;
}
case PolicyAuditEventsInformation: /* 2 */
Status = LsarSetAuditEvents(PolicyObject,
(PLSAPR_POLICY_AUDIT_EVENTS_INFO)PolicyInformation);
+ if (NT_SUCCESS(Status))
+ LsapNotifyPolicyChange(PolicyNotifyAuditEventsInformation);
break;
case PolicyPrimaryDomainInformation: /* 3 */
Status = LsarSetPrimaryDomain(PolicyObject,
(PLSAPR_POLICY_PRIMARY_DOM_INFO)PolicyInformation);
+ if (NT_SUCCESS(Status))
+ LsapNotifyPolicyChange(PolicyNotifyDnsDomainInformation);
break;
case PolicyAccountDomainInformation: /* 5 */
Status = LsarSetAccountDomain(PolicyObject,
(PLSAPR_POLICY_ACCOUNT_DOM_INFO)PolicyInformation);
+ if (NT_SUCCESS(Status))
+ LsapNotifyPolicyChange(PolicyNotifyAccountDomainInformation);
break;
case PolicyLsaServerRoleInformation: /* 6 */
Status = LsarSetServerRole(PolicyObject,
(PPOLICY_LSA_SERVER_ROLE_INFO)PolicyInformation);
+ if (NT_SUCCESS(Status))
+ LsapNotifyPolicyChange(PolicyNotifyServerRoleInformation);
break;
case PolicyReplicaSourceInformation: /* 7 */
case PolicyDnsDomainInformation: /* 12 (0xC) */
Status = LsarSetDnsDomain(PolicyObject,
(PLSAPR_POLICY_DNS_DOMAIN_INFO)PolicyInformation);
+ if (NT_SUCCESS(Status))
+ LsapNotifyPolicyChange(PolicyNotifyDnsDomainInformation);
break;
case PolicyDnsDomainInformationInt: /* 13 (0xD) */
AccountObject);
if (!NT_SUCCESS(Status))
{
- ERR("LsapOpenDbObject failed (Status 0x%08lx)\n", Status);
+ ERR("LsapOpenDbObject(Accounts/%S) failed (Status 0x%08lx)\n", SidString, Status);
}
if (SidString != NULL)
/* Function 60 */
NTSTATUS WINAPI CredrWrite(
- handle_t hBinding)
+ PLSAPR_SERVER_NAME SystemName)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
/* Function 61 */
NTSTATUS WINAPI CredrRead(
- handle_t hBinding)
+ PLSAPR_SERVER_NAME SystemName)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
/* Function 62 */
NTSTATUS WINAPI CredrEnumerate(
- handle_t hBinding)
+ PLSAPR_SERVER_NAME SystemName)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
/* Function 63 */
NTSTATUS WINAPI CredrWriteDomainCredentials(
- handle_t hBinding)
+ PLSAPR_SERVER_NAME SystemName)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
/* Function 64 */
NTSTATUS WINAPI CredrReadDomainCredentials(
- handle_t hBinding)
+ PLSAPR_SERVER_NAME SystemName)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
/* Function 65 */
-NTSTATUS WINAPI CredrDelete(
- handle_t hBinding)
+NTSTATUS
+WINAPI
+CredrDelete(
+ PLSAPR_SERVER_NAME SystemName,
+ LPWSTR TargetName,
+ DWORD Type,
+ DWORD Flags)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
/* Function 66 */
-NTSTATUS WINAPI CredrGetTargetInfo(
- handle_t hBinding)
+NTSTATUS
+WINAPI
+CredrGetTargetInfo(
+ PLSAPR_SERVER_NAME SystemName,
+ LPWSTR TargetName,
+ DWORD Flags,
+ CREDPR_TARGET_INFORMATION *TargetInformation)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
/* Function 67 */
-NTSTATUS WINAPI CredrProfileLoaded(
- handle_t hBinding)
+NTSTATUS
+WINAPI
+CredrProfileLoaded(
+ PLSAPR_SERVER_NAME SystemName)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
/* Function 69 */
-NTSTATUS WINAPI CredrGetSessionTypes(
- handle_t hBinding)
+NTSTATUS
+WINAPI
+CredrGetSessionTypes(
+ PLSAPR_SERVER_NAME SystemName,
+ DWORD MaximumPersistCount,
+ DWORD *MaximumPersist)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
/* Function 75 */
-NTSTATUS WINAPI CredrRename(
- handle_t hBinding)
+NTSTATUS
+WINAPI
+CredrRename(
+ PLSAPR_SERVER_NAME SystemName,
+ LPWSTR OldTargetName,
+ LPWSTR NewTargetName,
+ DWORD Type,
+ DWORD Flags)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;