Книга: Microsoft Windows Embedded CE 6.0 Exam Preparation Kit
Synchronous Access
Synchronous Access
Synchronous memory access is synonymous with non-concurrent buffer access. The caller's thread waits until the function call returns, such as DeviceIoControl, and there are no other threads in the caller process that access the buffer while the driver performs its processing tasks. In this scenario, the device driver can use parameter pointers and embedded pointers (after a call to CeOpenCallerBuffer) without additional precautions.
The following is an example of accessing a buffer from an application synchronously. This sample source code is an excerpt from an XXX_IOControl function of a stream driver:
BOOL SMP_IOControl(DWORD hOpenContext, DWORD dwCode,
PBYTE pBufIn, DWORD dwLenIn, PBYTE pBufOut, DWORD dwLenOut,
PDWORD pdwActualOut) {
BYTE *lpBuff = NULL;
...
if (dwCode == IOCTL_A_WRITE_FUNCTION) {
// Check parameters
if ( pBufIn == NULL || dwLenIn != sizeof(AN_INPUT_STRUCTURE)) {
DEBUGMSG(ZONE_IOCTL, (TEXT("Bad parametersrn")));
return FALSE;
}
// Access input buffer
hrMemAccessVal = CeOpenCallerBuffer((PVOID) &lpBuff,
(PVOID) pBufIn, dwLenIn, ARG_I_PTR, FALSE);
// Check hrMemAccessVal value
// Access the pBufIn through lpBuff
...
// Close the buffer when it is no longer needed
CeCloseCallerBuffer((PVOID)lpBuff, (PVOID)pBufOut,
dwLenOut, ARG_I_PTR);
}
...
}
- Asynchronous Access
- Практическая работа 53. Запуск Access. Работа с объектами базы данных
- Configure Access Control
- Запуск Access. Открытие учебной базы данных Борей
- 7.5.1. Файлы .htaccess
- Основы интерфейса Access 2007
- Листинг 10.2. Пример конфигурационного файла ftpaccess
- Глава 7 Разработка баз данных в программе Access
- Урок 7.1. Знакомство с программой Access
- Access 2007 как реляционная система управления базами данных
- 15.6.1 Synchronous Activity Synchronization
- CHAPTER 15 Remote Access with SSH