windowsshutdown

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Syntax UUID
	WindowsShutdownSyntaxUUID = &uuid.UUID{TimeLow: 0xd95afe70, TimeMid: 0xa6d5, TimeHiAndVersion: 0x4259, ClockSeqHiAndReserved: 0x82, ClockSeqLow: 0x2e, Node: [6]uint8{0x2c, 0x84, 0xda, 0x1d, 0xdb, 0xd}}
	// Syntax ID
	WindowsShutdownSyntaxV1_0 = &dcerpc.SyntaxID{IfUUID: WindowsShutdownSyntaxUUID, IfVersionMajor: 1, IfVersionMinor: 0}
)
View Source
var (
	// import guard
	GoPackage = "rsp"
)

Functions

func NewWindowsShutdownServerHandle

func NewWindowsShutdownServerHandle(o WindowsShutdownServer) dcerpc.ServerHandle

func RegisterWindowsShutdownServer

func RegisterWindowsShutdownServer(conn dcerpc.Conn, o WindowsShutdownServer, opts ...dcerpc.Option)

func WindowsShutdownServerHandle

func WindowsShutdownServerHandle(ctx context.Context, o WindowsShutdownServer, opNum int, r ndr.Reader) (dcerpc.Operation, error)

Types

type AbortShutdownRequest

type AbortShutdownRequest struct {
	// lpClientHint: Used only for diagnostic purposes (logging the image file name of the
	// process canceling a shutdown).
	ClientHint *rsp.UnicodeString `idl:"name:lpClientHint;pointer:unique" json:"client_hint"`
}

AbortShutdownRequest structure represents the WsdrAbortShutdown operation request

func (*AbortShutdownRequest) MarshalNDR

func (o *AbortShutdownRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error

func (*AbortShutdownRequest) UnmarshalNDR

func (o *AbortShutdownRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error

type AbortShutdownResponse

type AbortShutdownResponse struct {
	// Return: The WsdrAbortShutdown return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

AbortShutdownResponse structure represents the WsdrAbortShutdown operation response

func (*AbortShutdownResponse) MarshalNDR

func (o *AbortShutdownResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error

func (*AbortShutdownResponse) UnmarshalNDR

func (o *AbortShutdownResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error

type InitiateShutdownRequest

type InitiateShutdownRequest struct {
	// lpMessage: Null-terminated Unicode string that contains the message to display during
	// the shutdown waiting period. If this parameter is NULL, no message MUST be displayed.
	Message *rsp.UnicodeString `idl:"name:lpMessage;pointer:unique" json:"message"`
	// dwGracePeriod: Number of seconds to wait before shutting down.
	GracePeriod uint32 `idl:"name:dwGracePeriod" json:"grace_period"`
	// dwShudownFlags: A set of bit flags in little-endian format used as a mask to indicate
	// shutdown options. The value is constructed from zero or more bit flags from the following
	// table, with the exception that flag "B" cannot be combined with "C" or "D".
	//
	//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
	//	| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 | 1 |
	//	|   |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |
	//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
	//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
	//	| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | G | F | E | D | C | B | 0 | A |
	//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
	//
	// The bits are defined as follows.
	//
	//	+--------------+----------------------------------------------------------------------------------+
	//	|              |                                                                                  |
	//	|    VALUE     |                                     MEANING                                      |
	//	|              |                                                                                  |
	//	+--------------+----------------------------------------------------------------------------------+
	//	+--------------+----------------------------------------------------------------------------------+
	//	| A 0x00000001 | All applications SHOULD be terminated unconditionally. An alternate for this     |
	//	|              | field is SHUTDOWN_FORCE_OTHERS.                                                  |
	//	+--------------+----------------------------------------------------------------------------------+
	//	| B 0x00000004 | Restart computer. Cannot be used with "C" or "D". An alternate name for this     |
	//	|              | field is SHUTDOWN_RESTART.                                                       |
	//	+--------------+----------------------------------------------------------------------------------+
	//	| C 0x00000008 | The shutdown SHOULD turn off the computer. Cannot be used with "B" or "D". An    |
	//	|              | alternate name for this field is SHUTDOWN_POWEROFF.                              |
	//	+--------------+----------------------------------------------------------------------------------+
	//	| D 0x00000010 | The shutdown SHOULD leave the computer powered but SHOULD NOT cause a            |
	//	|              | reboot. Cannot be used with "B" or "C". An alternate name for this field is      |
	//	|              | SHUTDOWN_NOREBOOT.                                                               |
	//	+--------------+----------------------------------------------------------------------------------+
	//	| E 0x00000020 | If a shutdown is currently in progress, setting this bit on a subsequent         |
	//	|              | shutdown request SHOULD cause the ongoing request's waiting period to be ignored |
	//	|              | and SHOULD cause an immediate shutdown. An alternate name for this field is      |
	//	|              | SHUTDOWN_GRACE_OVERRIDE.                                                         |
	//	+--------------+----------------------------------------------------------------------------------+
	//	| F 0x00000040 | The shutdown SHOULD install pending software updates before proceeding. An       |
	//	|              | alternate name for this field is SHUTDOWN_INSTALL_UPDATES.                       |
	//	+--------------+----------------------------------------------------------------------------------+
	//	| G 0x00000080 | The shutdown SHOULD restart the computer and then restart any applications       |
	//	|              | that have registered for restart. An alternate name for this field is            |
	//	|              | SHUTDOWN_RESTARTAPPS.                                                            |
	//	+--------------+----------------------------------------------------------------------------------+
	ShudownFlags uint32 `idl:"name:dwShudownFlags" json:"shudown_flags"`
	// dwReason: Reason for initiating the shutdown (section 2.3). The dwReason SHOULD be
	// used for log entries for the shutdown event.
	Reason uint32 `idl:"name:dwReason" json:"reason"`
	// lpClientHint: Used only for diagnostic purposes (logging the image file name of the
	// process initiating a shutdown).
	ClientHint *rsp.UnicodeString `idl:"name:lpClientHint;pointer:unique" json:"client_hint"`
}

InitiateShutdownRequest structure represents the WsdrInitiateShutdown operation request

func (*InitiateShutdownRequest) MarshalNDR

func (o *InitiateShutdownRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error

func (*InitiateShutdownRequest) UnmarshalNDR

func (o *InitiateShutdownRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error

type InitiateShutdownResponse

type InitiateShutdownResponse struct {
	// Return: The WsdrInitiateShutdown return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

InitiateShutdownResponse structure represents the WsdrInitiateShutdown operation response

func (*InitiateShutdownResponse) MarshalNDR

func (o *InitiateShutdownResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error

func (*InitiateShutdownResponse) UnmarshalNDR

func (o *InitiateShutdownResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error

type WindowsShutdownClient

type WindowsShutdownClient interface {

	// The WsdrInitiateShutdown method is used to initiate the shutdown of the remote computer.<14>
	//
	// Return Values: The method returns ERROR_SUCCESS (0x00000000) on success; otherwise,
	// it returns a nonzero error code.
	InitiateShutdown(context.Context, *InitiateShutdownRequest, ...dcerpc.CallOption) (*InitiateShutdownResponse, error)

	// The WsdrAbortShutdown method is used to terminate the shutdown of the remote computer
	// within the waiting period.<15>
	//
	// Return Values: The method returns ERROR_SUCCESS (0x00000000) on success; otherwise,
	// it returns a nonzero error code.
	AbortShutdown(context.Context, *AbortShutdownRequest, ...dcerpc.CallOption) (*AbortShutdownResponse, error)

	// AlterContext alters the client context.
	AlterContext(context.Context, ...dcerpc.Option) error
}

WindowsShutdown interface.

func NewWindowsShutdownClient

func NewWindowsShutdownClient(ctx context.Context, cc dcerpc.Conn, opts ...dcerpc.Option) (WindowsShutdownClient, error)

type WindowsShutdownServer

type WindowsShutdownServer interface {

	// The WsdrInitiateShutdown method is used to initiate the shutdown of the remote computer.<14>
	//
	// Return Values: The method returns ERROR_SUCCESS (0x00000000) on success; otherwise,
	// it returns a nonzero error code.
	InitiateShutdown(context.Context, *InitiateShutdownRequest) (*InitiateShutdownResponse, error)

	// The WsdrAbortShutdown method is used to terminate the shutdown of the remote computer
	// within the waiting period.<15>
	//
	// Return Values: The method returns ERROR_SUCCESS (0x00000000) on success; otherwise,
	// it returns a nonzero error code.
	AbortShutdown(context.Context, *AbortShutdownRequest) (*AbortShutdownResponse, error)
}

WindowsShutdown server interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL