Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function is used to send a control code to a service.

Syntax

BOOL xxx_IOControl(
  DWORD 
dwData,
  DWORD 
dwCode,
  PBYTE 
pBufIn,
  DWORD 
dwLenIn,
  PBYTE 
pBufOut,
  DWORD 
dwLenOut,
  PDWORD 
pdwActualOut
);

Parameters

dwData

[in] Specifies the value returned by xxx_Init (Services.exe)for the given service instance.

dwCode

[in] Specifies the control code for the operation. This value identifies the specific operation to be performed and the type of device on which to perform it.

pBufIn

[in] Pointer to a buffer that contains the data required to perform the operation. This parameter can be NULL if the dwCodeparameter specifies an operation that does not require data.

dwLenIn

[in] Specifies the size, in bytes, of the buffer pointed to by pBufIn.

pBufOut

[out] Pointer to a buffer that receives the output data from the operation. This parameter can be NULL if the dwCodeparameter specifies an operation that does not produce output data.

dwLenOut

[in] Specifies the size, in bytes, of the buffer pointed to by pBufOut.

pdwActualOut

[out] Pointer to a variable that receives the size, in bytes, of the data stored into the buffer pointed to by pBufOut. If the output buffer is too small to return any data, then the call fails and GetLastErrorreturns the error code ERROR_INSUFFICIENT_BUFFER, and the returned byte count is zero.

Return Value

TRUE indicates success. FALSE indicates failure.

Remarks

The control code specifies the action that the driver is to perform. For example, a control code can ask a service to return information or direct the service to carry out an action. Windows Embedded CE. NET provides a number of standard control codes. In addition, a service can define its own service-specific control code. For more information, see Services.exe IOCTLS.

Services.exe uses the xxxprefix. When implementing the stream interface, replace xxxwith a prefix appropriate for your specific implementation.

Note:
In the past, some services have used the parameters of xxx_IOControlincorrectly. For example, some services have used the pBufInparameter to pass a 32-bit DWORD value instead of a pointer. Services.exe no longer supports this incorrect usage. Before calling into your service, services.exe will now perform extra checks to make sure that the 32-bit value is a legal pointer. If the value for pBufInis not legal, services.exe will not call xxx_IOControl.

Requirements

Header Developer Implemented
Library Developer Implemented
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also