< prev index next >
src/jdk.accessibility/windows/native/libjavaaccessbridge/AccessBridgeATInstance.cpp
Print this page
*** 51,71 ****
/**
* AccessBridgeATInstance descructor
*/
AccessBridgeATInstance::~AccessBridgeATInstance() {
! PrintDebugString("\r\nin AccessBridgeATInstance::~AccessBridgeATInstance");
// if IPC memory mapped file view is valid, unmap it
if (memoryMappedView != (char *) 0) {
! PrintDebugString(" unmapping memoryMappedView; view = %p", memoryMappedView);
UnmapViewOfFile(memoryMappedView);
memoryMappedView = (char *) 0;
}
// if IPC memory mapped file handle map is open, close it
if (memoryMappedFileMapHandle != (HANDLE) 0) {
! PrintDebugString(" closing memoryMappedFileMapHandle; handle = %p", memoryMappedFileMapHandle);
CloseHandle(memoryMappedFileMapHandle);
memoryMappedFileMapHandle = (HANDLE) 0;
}
}
--- 51,71 ----
/**
* AccessBridgeATInstance descructor
*/
AccessBridgeATInstance::~AccessBridgeATInstance() {
! PrintDebugString("[INFO]: in AccessBridgeATInstance::~AccessBridgeATInstance");
// if IPC memory mapped file view is valid, unmap it
if (memoryMappedView != (char *) 0) {
! PrintDebugString("[INFO]: unmapping memoryMappedView; view = %p", memoryMappedView);
UnmapViewOfFile(memoryMappedView);
memoryMappedView = (char *) 0;
}
// if IPC memory mapped file handle map is open, close it
if (memoryMappedFileMapHandle != (HANDLE) 0) {
! PrintDebugString("[INFO]: closing memoryMappedFileMapHandle; handle = %p", memoryMappedFileMapHandle);
CloseHandle(memoryMappedFileMapHandle);
memoryMappedFileMapHandle = (HANDLE) 0;
}
}
*** 85,127 ****
*/
LRESULT
AccessBridgeATInstance::initiateIPC() {
DWORD errorCode;
! PrintDebugString("\r\nIn AccessBridgeATInstance::initiateIPC()");
// open Windows-initiated IPC filemap & map it to a ptr
memoryMappedFileMapHandle = OpenFileMapping(FILE_MAP_READ | FILE_MAP_WRITE,
FALSE, memoryMappedFileName);
if (memoryMappedFileMapHandle == NULL) {
errorCode = GetLastError();
! PrintDebugString(" Failed to CreateFileMapping for %s, error: %X", memoryMappedFileName, errorCode);
return errorCode;
} else {
! PrintDebugString(" CreateFileMapping worked - filename: %s", memoryMappedFileName);
}
memoryMappedView = (char *) MapViewOfFile(memoryMappedFileMapHandle,
FILE_MAP_READ | FILE_MAP_WRITE,
0, 0, 0);
if (memoryMappedView == NULL) {
errorCode = GetLastError();
! PrintDebugString(" Failed to MapViewOfFile for %s, error: %X", memoryMappedFileName, errorCode);
return errorCode;
} else {
! PrintDebugString(" MapViewOfFile worked - view: %p", memoryMappedView);
}
// look for the JavaDLL's answer to see if it could read the file
if (strcmp(memoryMappedView, AB_MEMORY_MAPPED_FILE_OK_QUERY) != 0) {
! PrintDebugString(" JavaVM failed to write to memory mapped file %s",
memoryMappedFileName);
return -1;
} else {
! PrintDebugString(" JavaVM successfully wrote to file!");
}
// write some data to the memory mapped file for WindowsDLL to verify
strcpy(memoryMappedView, AB_MEMORY_MAPPED_FILE_OK_ANSWER);
--- 85,127 ----
*/
LRESULT
AccessBridgeATInstance::initiateIPC() {
DWORD errorCode;
! PrintDebugString("[INFO]: In AccessBridgeATInstance::initiateIPC()");
// open Windows-initiated IPC filemap & map it to a ptr
memoryMappedFileMapHandle = OpenFileMapping(FILE_MAP_READ | FILE_MAP_WRITE,
FALSE, memoryMappedFileName);
if (memoryMappedFileMapHandle == NULL) {
errorCode = GetLastError();
! PrintDebugString("[ERROR]: Failed to CreateFileMapping for %s, error: %X", memoryMappedFileName, errorCode);
return errorCode;
} else {
! PrintDebugString("[INFO]: CreateFileMapping worked - filename: %s", memoryMappedFileName);
}
memoryMappedView = (char *) MapViewOfFile(memoryMappedFileMapHandle,
FILE_MAP_READ | FILE_MAP_WRITE,
0, 0, 0);
if (memoryMappedView == NULL) {
errorCode = GetLastError();
! PrintDebugString("[ERROR]: Failed to MapViewOfFile for %s, error: %X", memoryMappedFileName, errorCode);
return errorCode;
} else {
! PrintDebugString("[INFO]: MapViewOfFile worked - view: %p", memoryMappedView);
}
// look for the JavaDLL's answer to see if it could read the file
if (strcmp(memoryMappedView, AB_MEMORY_MAPPED_FILE_OK_QUERY) != 0) {
! PrintDebugString("[ERROR]: JavaVM failed to write to memory mapped file %s",
memoryMappedFileName);
return -1;
} else {
! PrintDebugString("[INFO]: JavaVM successfully wrote to file!");
}
// write some data to the memory mapped file for WindowsDLL to verify
strcpy(memoryMappedView, AB_MEMORY_MAPPED_FILE_OK_ANSWER);
*** 211,222 ****
*
*/
LRESULT
AccessBridgeATInstance::sendJavaEventPackage(char *buffer, int bufsize, long eventID) {
! PrintDebugString("AccessBridgeATInstance::sendJavaEventPackage() eventID = %X", eventID);
! PrintDebugString("AccessBridgeATInstance::sendJavaEventPackage() (using PostMessage) eventID = %X", eventID);
if (eventID & javaEventMask) {
do_event(buffer,bufsize,ourAccessBridgeWindow,winAccessBridgeWindow);
return(0);
} else {
--- 211,222 ----
*
*/
LRESULT
AccessBridgeATInstance::sendJavaEventPackage(char *buffer, int bufsize, long eventID) {
! PrintDebugString("[INFO]: AccessBridgeATInstance::sendJavaEventPackage() eventID = %X", eventID);
! PrintDebugString("[INFO]: AccessBridgeATInstance::sendJavaEventPackage() (using PostMessage) eventID = %X", eventID);
if (eventID & javaEventMask) {
do_event(buffer,bufsize,ourAccessBridgeWindow,winAccessBridgeWindow);
return(0);
} else {
*** 232,242 ****
*
*/
LRESULT
AccessBridgeATInstance::sendAccessibilityEventPackage(char *buffer, int bufsize, long eventID) {
! PrintDebugString("AccessBridgeATInstance::sendAccessibilityEventPackage() eventID = %X", eventID);
if (eventID & accessibilityEventMask) {
do_event(buffer,bufsize,ourAccessBridgeWindow,winAccessBridgeWindow);
return(0);
} else {
--- 232,242 ----
*
*/
LRESULT
AccessBridgeATInstance::sendAccessibilityEventPackage(char *buffer, int bufsize, long eventID) {
! PrintDebugString("[INFO]: AccessBridgeATInstance::sendAccessibilityEventPackage() eventID = %X", eventID);
if (eventID & accessibilityEventMask) {
do_event(buffer,bufsize,ourAccessBridgeWindow,winAccessBridgeWindow);
return(0);
} else {
< prev index next >