mirror of
https://github.com/reactos/reactos.git
synced 2024-08-07 19:58:21 +00:00
Added some some missing exports for wine module linkage.
Shutdown was a mess from *nix newlines. svn path=/trunk/; revision=3950
This commit is contained in:
parent
ae2157bade
commit
b4ed26f8da
|
@ -1,4 +1,4 @@
|
|||
; $Id: advapi32.edf,v 1.16 2002/08/17 15:57:22 robd Exp $
|
||||
; $Id: advapi32.edf,v 1.17 2003/01/07 17:32:58 robd Exp $
|
||||
;
|
||||
; advapi32.edf
|
||||
;
|
||||
|
@ -206,7 +206,7 @@ LookupPrivilegeValueW=LookupPrivilegeValueW@12
|
|||
;LsaAddAccountRights=LsaAddAccountRights@16
|
||||
;LsaAddPrivilegesToAccount=LsaAddPrivilegesToAccount@8
|
||||
;LsaClearAuditLog=LsaClearAuditLog@4
|
||||
;LsaClose=LsaClose@4
|
||||
LsaClose=LsaClose@4
|
||||
;LsaCreateAccount=LsaCreateAccount@16
|
||||
;LsaCreateSecret=LsaCreateSecret@16
|
||||
;LsaCreateTrustedDomain=LsaCreateTrustedDomain@16
|
||||
|
@ -218,7 +218,7 @@ LookupPrivilegeValueW=LookupPrivilegeValueW@12
|
|||
;LsaEnumeratePrivileges=LsaEnumeratePrivileges@20
|
||||
;LsaEnumeratePrivilegesOfAccount=LsaEnumeratePrivilegesOfAccount@8
|
||||
;LsaEnumerateTrustedDomains=LsaEnumerateTrustedDomains@20
|
||||
;LsaFreeMemory=LsaFreeMemory@4
|
||||
LsaFreeMemory=LsaFreeMemory@4
|
||||
;LsaGetQuotasForAccount=LsaGetQuotasForAccount@8
|
||||
;LsaGetSystemAccessAccount=LsaGetSystemAccessAccount@8
|
||||
;LsaGetUserName=LsaGetUserName@8
|
||||
|
@ -229,13 +229,13 @@ LookupPrivilegeValueW=LookupPrivilegeValueW@12
|
|||
;LsaLookupPrivilegeName=LsaLookupPrivilegeName@12
|
||||
;LsaLookupPrivilegeValue=LsaLookupPrivilegeValue@12
|
||||
;LsaLookupSids=LsaLookupSids@20
|
||||
;LsaNtStatusToWinError=LsaNtStatusToWinError@4
|
||||
LsaNtStatusToWinError=LsaNtStatusToWinError@4
|
||||
;LsaOpenAccount=LsaOpenAccount@16
|
||||
;LsaOpenPolicy=LsaOpenPolicy@16
|
||||
LsaOpenPolicy=LsaOpenPolicy@16
|
||||
;LsaOpenSecret=LsaOpenSecret@16
|
||||
;LsaOpenTrustedDomain=LsaOpenTrustedDomain@16
|
||||
;LsaQueryInfoTrustedDomain=LsaQueryInfoTrustedDomain@12
|
||||
;LsaQueryInformationPolicy=LsaQueryInformationPolicy@12
|
||||
LsaQueryInformationPolicy=LsaQueryInformationPolicy@12
|
||||
;LsaQuerySecret=LsaQuerySecret@20
|
||||
;LsaQuerySecurityObject=LsaQuerySecurityObject@12
|
||||
;LsaQueryTrustedDomainInfo=LsaQueryTrustedDomainInfo@16
|
||||
|
|
|
@ -1,194 +1,149 @@
|
|||
/* $Id: shutdown.c,v 1.6 2002/11/14 18:21:03 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
* FILE: lib/advapi32/misc/shutdown.c
|
||||
* PURPOSE: System shutdown functions
|
||||
* PROGRAMMER: Emanuele Aliberti
|
||||
* UPDATE HISTORY:
|
||||
* 19990413 EA created
|
||||
* 19990515 EA
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#define NTOS_MODE_USER
|
||||
#include <ntos.h>
|
||||
|
||||
#define USZ {0,0,0}
|
||||
|
||||
/**********************************************************************
|
||||
* AbortSystemShutdownW
|
||||
*/
|
||||
WINBOOL
|
||||
STDCALL
|
||||
AbortSystemShutdownW(
|
||||
LPCWSTR lpMachineName
|
||||
)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* AbortSystemShutdownA
|
||||
*/
|
||||
BOOL
|
||||
STDCALL
|
||||
AbortSystemShutdownA(
|
||||
LPCSTR lpMachineName
|
||||
)
|
||||
{
|
||||
ANSI_STRING MachineNameA;
|
||||
UNICODE_STRING MachineNameW;
|
||||
NTSTATUS Status;
|
||||
BOOL rv;
|
||||
|
||||
RtlInitAnsiString(
|
||||
& MachineNameA,
|
||||
lpMachineName
|
||||
);
|
||||
Status = RtlAnsiStringToUnicodeString(
|
||||
& MachineNameW,
|
||||
& MachineNameA,
|
||||
TRUE
|
||||
);
|
||||
if (STATUS_SUCCESS != Status)
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
return FALSE;
|
||||
}
|
||||
rv = AbortSystemShutdownW(
|
||||
MachineNameW.Buffer
|
||||
);
|
||||
RtlFreeAnsiString(
|
||||
& MachineNameA
|
||||
);
|
||||
RtlFreeUnicodeString(
|
||||
& MachineNameW
|
||||
);
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* InitiateSystemShutdownW
|
||||
*/
|
||||
BOOL
|
||||
STDCALL
|
||||
InitiateSystemShutdownW(
|
||||
LPWSTR lpMachineName,
|
||||
LPWSTR lpMessage,
|
||||
DWORD dwTimeout,
|
||||
BOOL bForceAppsClosed,
|
||||
BOOL bRebootAfterShutdown
|
||||
)
|
||||
{
|
||||
SHUTDOWN_ACTION Action = ShutdownNoReboot;
|
||||
NTSTATUS Status;
|
||||
|
||||
if (lpMachineName)
|
||||
{
|
||||
/* FIXME: remote machine shutdown not supported yet */
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
if (dwTimeout)
|
||||
{
|
||||
}
|
||||
Status = NtShutdownSystem(Action);
|
||||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* InitiateSystemShutdownA
|
||||
*/
|
||||
BOOL
|
||||
STDCALL
|
||||
InitiateSystemShutdownA(
|
||||
LPSTR lpMachineName,
|
||||
LPSTR lpMessage,
|
||||
DWORD dwTimeout,
|
||||
BOOL bForceAppsClosed,
|
||||
BOOL bRebootAfterShutdown
|
||||
)
|
||||
{
|
||||
ANSI_STRING MachineNameA;
|
||||
ANSI_STRING MessageA;
|
||||
UNICODE_STRING MachineNameW;
|
||||
UNICODE_STRING MessageW;
|
||||
NTSTATUS Status;
|
||||
INT LastError;
|
||||
BOOL rv;
|
||||
|
||||
if (lpMachineName)
|
||||
{
|
||||
RtlInitAnsiString(
|
||||
& MachineNameA,
|
||||
lpMachineName
|
||||
);
|
||||
Status = RtlAnsiStringToUnicodeString(
|
||||
& MachineNameW,
|
||||
& MachineNameA,
|
||||
TRUE
|
||||
);
|
||||
if (STATUS_SUCCESS != Status)
|
||||
{
|
||||
RtlFreeAnsiString(&MachineNameA);
|
||||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
if (lpMessage)
|
||||
{
|
||||
RtlInitAnsiString(
|
||||
& MessageA,
|
||||
lpMessage
|
||||
);
|
||||
Status = RtlAnsiStringToUnicodeString(
|
||||
& MessageW,
|
||||
& MessageA,
|
||||
TRUE
|
||||
);
|
||||
if (STATUS_SUCCESS != Status)
|
||||
{
|
||||
if (MachineNameW.Length)
|
||||
{
|
||||
RtlFreeAnsiString(&MachineNameA);
|
||||
RtlFreeUnicodeString(&MachineNameW);
|
||||
}
|
||||
RtlFreeAnsiString(&MessageA);
|
||||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
rv = InitiateSystemShutdownW(
|
||||
MachineNameW.Buffer,
|
||||
MessageW.Buffer,
|
||||
dwTimeout,
|
||||
bForceAppsClosed,
|
||||
bRebootAfterShutdown
|
||||
);
|
||||
LastError = GetLastError();
|
||||
if (lpMachineName)
|
||||
{
|
||||
RtlFreeAnsiString(&MachineNameA);
|
||||
RtlFreeUnicodeString(&MachineNameW);
|
||||
}
|
||||
if (lpMessage)
|
||||
{
|
||||
RtlFreeAnsiString(&MessageA);
|
||||
RtlFreeUnicodeString(&MessageW);
|
||||
}
|
||||
SetLastError(LastError);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
/* EOF */
|
||||
|
||||
/* $Id: shutdown.c,v 1.7 2003/01/07 17:32:59 robd Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
* FILE: lib/advapi32/misc/shutdown.c
|
||||
* PURPOSE: System shutdown functions
|
||||
* PROGRAMMER: Emanuele Aliberti
|
||||
* UPDATE HISTORY:
|
||||
* 19990413 EA created
|
||||
* 19990515 EA
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#define NTOS_MODE_USER
|
||||
#include <ntos.h>
|
||||
|
||||
#define USZ {0,0,0}
|
||||
|
||||
/**********************************************************************
|
||||
* AbortSystemShutdownW
|
||||
*/
|
||||
WINBOOL
|
||||
STDCALL
|
||||
AbortSystemShutdownW(LPCWSTR lpMachineName)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* AbortSystemShutdownA
|
||||
*/
|
||||
BOOL
|
||||
STDCALL
|
||||
AbortSystemShutdownA(LPCSTR lpMachineName)
|
||||
{
|
||||
ANSI_STRING MachineNameA;
|
||||
UNICODE_STRING MachineNameW;
|
||||
NTSTATUS Status;
|
||||
BOOL rv;
|
||||
|
||||
RtlInitAnsiString(&MachineNameA, lpMachineName);
|
||||
Status = RtlAnsiStringToUnicodeString(&MachineNameW, &MachineNameA, TRUE);
|
||||
if (STATUS_SUCCESS != Status) {
|
||||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
return FALSE;
|
||||
}
|
||||
rv = AbortSystemShutdownW(MachineNameW.Buffer);
|
||||
RtlFreeAnsiString(&MachineNameA);
|
||||
RtlFreeUnicodeString(&MachineNameW);
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* InitiateSystemShutdownW
|
||||
*/
|
||||
BOOL
|
||||
STDCALL
|
||||
InitiateSystemShutdownW(
|
||||
LPWSTR lpMachineName,
|
||||
LPWSTR lpMessage,
|
||||
DWORD dwTimeout,
|
||||
BOOL bForceAppsClosed,
|
||||
BOOL bRebootAfterShutdown)
|
||||
{
|
||||
SHUTDOWN_ACTION Action = ShutdownNoReboot;
|
||||
NTSTATUS Status;
|
||||
|
||||
if (lpMachineName) {
|
||||
/* FIXME: remote machine shutdown not supported yet */
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
if (dwTimeout) {
|
||||
}
|
||||
Status = NtShutdownSystem(Action);
|
||||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* InitiateSystemShutdownA
|
||||
*/
|
||||
BOOL
|
||||
STDCALL
|
||||
InitiateSystemShutdownA(
|
||||
LPSTR lpMachineName,
|
||||
LPSTR lpMessage,
|
||||
DWORD dwTimeout,
|
||||
BOOL bForceAppsClosed,
|
||||
BOOL bRebootAfterShutdown)
|
||||
{
|
||||
ANSI_STRING MachineNameA;
|
||||
ANSI_STRING MessageA;
|
||||
UNICODE_STRING MachineNameW;
|
||||
UNICODE_STRING MessageW;
|
||||
NTSTATUS Status;
|
||||
INT LastError;
|
||||
BOOL rv;
|
||||
|
||||
if (lpMachineName) {
|
||||
RtlInitAnsiString(&MachineNameA, lpMachineName);
|
||||
Status = RtlAnsiStringToUnicodeString(&MachineNameW, &MachineNameA, TRUE);
|
||||
if (STATUS_SUCCESS != Status) {
|
||||
RtlFreeAnsiString(&MachineNameA);
|
||||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
if (lpMessage) {
|
||||
RtlInitAnsiString(&MessageA, lpMessage);
|
||||
Status = RtlAnsiStringToUnicodeString(&MessageW, &MessageA, TRUE);
|
||||
if (STATUS_SUCCESS != Status) {
|
||||
if (MachineNameW.Length) {
|
||||
RtlFreeAnsiString(&MachineNameA);
|
||||
RtlFreeUnicodeString(&MachineNameW);
|
||||
}
|
||||
RtlFreeAnsiString(&MessageA);
|
||||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
rv = InitiateSystemShutdownW(
|
||||
MachineNameW.Buffer,
|
||||
MessageW.Buffer,
|
||||
dwTimeout,
|
||||
bForceAppsClosed,
|
||||
bRebootAfterShutdown);
|
||||
LastError = GetLastError();
|
||||
if (lpMachineName) {
|
||||
RtlFreeAnsiString(&MachineNameA);
|
||||
RtlFreeUnicodeString(&MachineNameW);
|
||||
}
|
||||
if (lpMessage) {
|
||||
RtlFreeAnsiString(&MessageA);
|
||||
RtlFreeUnicodeString(&MessageW);
|
||||
}
|
||||
SetLastError(LastError);
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
Loading…
Reference in a new issue