\r
#include <sddl.h>\r
\r
+#ifndef STATUS_SUCCESS\r
+#define STATUS_SUCCESS ERROR_SUCCESS\r
+#endif\r
+\r
extern imports_t imports;\r
\r
/* Open Policy object. */\r
ZeroMemory(&attributes, sizeof(attributes));\r
\r
NTSTATUS status = LsaOpenPolicy(0, &attributes, POLICY_ALL_ACCESS, policy);\r
- if (status) {\r
+ if (status != STATUS_SUCCESS) {\r
print_message(stderr, NSSM_MESSAGE_LSAOPENPOLICY_FAILED, error_string(LsaNtStatusToWinError(status)));\r
return 1;\r
}\r
#endif\r
HeapFree(GetProcessHeap(), 0, expanded);\r
if (policy == &handle) LsaClose(handle);\r
- if (status) {\r
+ if (status != STATUS_SUCCESS) {\r
LsaFreeMemory(translated_domains);\r
LsaFreeMemory(translated_sid);\r
print_message(stderr, NSSM_MESSAGE_LSALOOKUPNAMES_FAILED, username, error_string(LsaNtStatusToWinError(status)));\r
LSA_REFERENCED_DOMAIN_LIST *translated_domains;\r
LSA_TRANSLATED_NAME *translated_name;\r
NTSTATUS status = LsaLookupSids(policy, 1, &sids, &translated_domains, &translated_name);\r
- if (status) {\r
+ if (status != STATUS_SUCCESS) {\r
LsaFreeMemory(translated_domains);\r
LsaFreeMemory(translated_name);\r
print_message(stderr, NSSM_MESSAGE_LSALOOKUPSIDS_FAILED, error_string(LsaNtStatusToWinError(status)));\r
LSA_UNICODE_STRING *rights;\r
unsigned long count = ~0;\r
status = LsaEnumerateAccountRights(policy, sid, &rights, &count);\r
- if (status) {\r
+ if (status != STATUS_SUCCESS) {\r
/*\r
If the account has no rights set LsaEnumerateAccountRights() will return\r
STATUS_OBJECT_NAME_NOT_FOUND and set count to 0.\r
status = LsaAddAccountRights(policy, sid, &lsa_right, 1);\r
FreeSid(sid);\r
LsaClose(policy);\r
- if (status) {\r
+ if (status != STATUS_SUCCESS) {\r
print_message(stderr, NSSM_MESSAGE_LSAADDACCOUNTRIGHTS_FAILED, error_string(LsaNtStatusToWinError(status)));\r
return 5;\r
}\r