SYSTEM_POWER_STATUS structure (winbase.h)
Contains information about the power status of the system.
Syntax
Members
The AC power status. This member can be one of the following values.
Value | Meaning |
---|---|
0 | Offline |
1 | Online |
255 | Unknown status |
The battery charge status. This member can contain one or more of the following flags.
Value | Meaning |
---|---|
1 | High—the battery capacity is at more than 66 percent |
2 | Low—the battery capacity is at less than 33 percent |
4 | Critical—the battery capacity is at less than five percent |
8 | Charging |
128 | No system battery |
255 | Unknown status—unable to read the battery flag information |
В
The value is zero if the battery is not being charged and the battery capacity is between low and high.
The percentage of full battery charge remaining. This member can be a value in the range 0 to 100, or 255 if status is unknown.
The status of battery saver. To participate in energy conservation, avoid resource intensive tasks when battery saver is on. To be notified when this value changes, call the RegisterPowerSettingNotification function with the power setting GUID, GUID_POWER_SAVING_STATUS.
Value | Meaning |
---|---|
0 | Battery saver is off. |
1 | Battery saver on. Save energy where possible. |
В
The number of seconds of battery life remaining, or –1 if remaining seconds are unknown or if the device is connected to AC power.
The number of seconds of battery life when at full charge, or –1 if full battery lifetime is unknown or if the device is connected to AC power.
Remarks
The system is only capable of estimating BatteryFullLifeTime based on calculations on BatteryLifeTime and BatteryLifePercent. Without smart battery subsystems, this value may not be accurate enough to be useful.
MoveFileW function (winbase.h)
Moves an existing file or a directory, including its children.
To specify how to move the file, use the MoveFileEx or MoveFileWithProgress function.
To perform this operation as a transacted operation, use the MoveFileTransacted function.
Syntax
Parameters
The current name of the file or directory on the local computer.
In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend «\?» to the path. For more information, see Naming a File.
The new name for the file or directory. The new name must not already exist. A new file may be on a different file system or drive. A new directory must be on the same drive.
In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend «\?» to the path. For more information, see Naming a File.
Return value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The MoveFile function will move (rename) either a file or a directory (including its children) either in the same directory or across directories. The one caveat is that the MoveFile function will fail on directory moves when the destination is on a different volume.
If a file is moved across volumes, MoveFile does not move the security descriptor with the file. The file will be assigned the default security descriptor in the destination directory.
The MoveFile function coordinates its operation with the link tracking service, so link sources can be tracked as they are moved.
In WindowsВ 8 and Windows ServerВ 2012, this function is supported by the following technologies.
Technology | Supported |
---|---|
Server Message Block (SMB) 3.0 protocol | Yes |
SMB 3.0 Transparent Failover (TFO) | See comment |
SMB 3.0 with Scale-out File Shares (SO) | See comment |
Cluster Shared Volume File System (CsvFS) | Yes |
Resilient File System (ReFS) | Yes |
В
SMB 3.0 does not support rename of alternate data streams on file shares with continuous availability capability.
The winbase.h header defines MoveFile as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
MoveFileA function (winbase.h)
Moves an existing file or a directory, including its children.
To specify how to move the file, use the MoveFileEx or MoveFileWithProgress function.
To perform this operation as a transacted operation, use the MoveFileTransacted function.
Syntax
Parameters
The current name of the file or directory on the local computer.
In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend «\?» to the path. For more information, see Naming a File.
The new name for the file or directory. The new name must not already exist. A new file may be on a different file system or drive. A new directory must be on the same drive.
In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend «\?» to the path. For more information, see Naming a File.
Return value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The MoveFile function will move (rename) either a file or a directory (including its children) either in the same directory or across directories. The one caveat is that the MoveFile function will fail on directory moves when the destination is on a different volume.
If a file is moved across volumes, MoveFile does not move the security descriptor with the file. The file will be assigned the default security descriptor in the destination directory.
The MoveFile function coordinates its operation with the link tracking service, so link sources can be tracked as they are moved.
In WindowsВ 8 and Windows ServerВ 2012, this function is supported by the following technologies.
Technology | Supported |
---|---|
Server Message Block (SMB) 3.0 protocol | Yes |
SMB 3.0 Transparent Failover (TFO) | See comment |
SMB 3.0 with Scale-out File Shares (SO) | See comment |
Cluster Shared Volume File System (CsvFS) | Yes |
Resilient File System (ReFS) | Yes |
В
SMB 3.0 does not support rename of alternate data streams on file shares with continuous availability capability.
The winbase.h header defines MoveFile as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
DCB structure (winbase.h)
Defines the control setting for a serial communications device.
Syntax
Members
The length of the structure, in bytes. The caller must set this member to sizeof(DCB) .
The baud rate at which the communications device operates. This member can be an actual baud rate value, or one of the following indexes.
Value | Meaning |
---|---|
CBR_110 110 | 110 bps |
CBR_300 300 | 300 bps |
CBR_600 600 | 600 bps |
CBR_1200 1200 | 1200 bps |
CBR_2400 2400 | 2400 bps |
CBR_4800 4800 | 4800 bps |
CBR_9600 9600 | 9600 bps |
CBR_14400 14400 | 14400 bps |
CBR_19200 19200 | 19200 bps |
CBR_38400 38400 | 38400 bps |
CBR_57600 57600 | 57600 bps |
CBR_115200 115200 | 115200 bps |
CBR_128000 128000 | 128000 bps |
CBR_256000 256000 | 256000 bps |
If this member is TRUE, binary mode is enabled. Windows does not support nonbinary mode transfers, so this member must be TRUE.
If this member is TRUE, parity checking is performed and errors are reported.
If this member is TRUE, the CTS (clear-to-send) signal is monitored for output flow control. If this member is TRUE and CTS is turned off, output is suspended until CTS is sent again.
If this member is TRUE, the DSR (data-set-ready) signal is monitored for output flow control. If this member is TRUE and DSR is turned off, output is suspended until DSR is sent again.
The DTR (data-terminal-ready) flow control. This member can be one of the following values.
Value | Meaning |
---|---|
DTR_CONTROL_DISABLE 0x00 | Disables the DTR line when the device is opened and leaves it disabled. |
DTR_CONTROL_ENABLE 0x01 | Enables the DTR line when the device is opened and leaves it on. |
DTR_CONTROL_HANDSHAKE 0x02 | Enables DTR handshaking. If handshaking is enabled, it is an error for the application to adjust the line by using the EscapeCommFunction function. |
If this member is TRUE, the communications driver is sensitive to the state of the DSR signal. The driver ignores any bytes received, unless the DSR modem input line is high.
If this member is TRUE, transmission continues after the input buffer has come within XoffLim bytes of being full and the driver has transmitted the XoffChar character to stop receiving bytes. If this member is FALSE, transmission does not continue until the input buffer is within XonLim bytes of being empty and the driver has transmitted the XonChar character to resume reception.
Indicates whether XON/XOFF flow control is used during transmission. If this member is TRUE, transmission stops when the XoffChar character is received and starts again when the XonChar character is received.
Indicates whether XON/XOFF flow control is used during reception. If this member is TRUE, the XoffChar character is sent when the input buffer comes within XoffLim bytes of being full, and the XonChar character is sent when the input buffer comes within XonLim bytes of being empty.
Indicates whether bytes received with parity errors are replaced with the character specified by the ErrorChar member. If this member is TRUE and the fParity member is TRUE, replacement occurs.
If this member is TRUE, null bytes are discarded when received.
The RTS (request-to-send) flow control. This member can be one of the following values.
Value | Meaning |
---|---|
RTS_CONTROL_DISABLE 0x00 | Disables the RTS line when the device is opened and leaves it disabled. |
RTS_CONTROL_ENABLE 0x01 | Enables the RTS line when the device is opened and leaves it on. |
RTS_CONTROL_HANDSHAKE 0x02 | Enables RTS handshaking. The driver raises the RTS line when the «type-ahead» (input) buffer is less than one-half full and lowers the RTS line when the buffer is more than three-quarters full. If handshaking is enabled, it is an error for the application to adjust the line by using the EscapeCommFunction function. |
RTS_CONTROL_TOGGLE 0x03 | Specifies that the RTS line will be high if bytes are available for transmission. After all buffered bytes have been sent, the RTS line will be low. |
If this member is TRUE, the driver terminates all read and write operations with an error status if an error occurs. The driver will not accept any further communications operations until the application has acknowledged the error by calling the ClearCommError function.
Reserved; do not use.
Reserved; must be zero.
The minimum number of bytes in use allowed in the input buffer before flow control is activated to allow transmission by the sender. This assumes that either XON/XOFF, RTS, or DTR input flow control is specified in the fInX, fRtsControl, or fDtrControl members.
The minimum number of free bytes allowed in the input buffer before flow control is activated to inhibit the sender. Note that the sender may transmit characters after the flow control signal has been activated, so this value should never be zero. This assumes that either XON/XOFF, RTS, or DTR input flow control is specified in the fInX, fRtsControl, or fDtrControl members. The maximum number of bytes in use allowed is calculated by subtracting this value from the size, in bytes, of the input buffer.
The number of bits in the bytes transmitted and received.
The parity scheme to be used. This member can be one of the following values.
Value | Meaning |
---|---|
EVENPARITY 2 | Even parity. |
MARKPARITY 3 | Mark parity. |
NOPARITY 0 | No parity. |
ODDPARITY 1 | Odd parity. |
SPACEPARITY 4 | Space parity. |
The number of stop bits to be used. This member can be one of the following values.
Value | Meaning |
---|---|
ONESTOPBIT 0 | 1 stop bit. |
ONE5STOPBITS 1 | 1.5 stop bits. |
TWOSTOPBITS 2 | 2 stop bits. |
The value of the XON character for both transmission and reception.
The value of the XOFF character for both transmission and reception.
The value of the character used to replace bytes received with a parity error.
The value of the character used to signal the end of data.
The value of the character used to signal an event.
Reserved; do not use.
Remarks
When a DCB structure is used to configure the 8250, the following restrictions apply to the values specified for the ByteSize and StopBits members:
- The number of data bits must be 5 to 8 bits.
- The use of 5 data bits with 2 stop bits is an invalid combination, as is 6, 7, or 8 data bits with 1.5 stop bits.