Package com.sun.jna.examples.win32

Examples of com.sun.jna.examples.win32.Kernel32.GetLastError()


           
            if (!klib.ReadDirectoryChangesW(finfo.handle, finfo.info,
                                            finfo.info.size(), finfo.recursive,
                                            finfo.notifyMask, finfo.infoLength,
                                            finfo.overlapped, null)) {
                int err = klib.GetLastError();
                throw new IOException("ReadDirectoryChangesW failed on "
                                      + finfo.file + ": '"
                                      + getSystemError(err)
                                      + "' (" + err + ")");
            }
View Full Code Here


                                            Kernel32.FILE_LIST_DIRECTORY,
                                            mask, null, Kernel32.OPEN_EXISTING,
                                            flags, null);
            if (Kernel32.INVALID_HANDLE_VALUE.equals(handle)) {
                throw new IOException("Unable to open " + file + " ("
                                      + klib.GetLastError() + ")");
            }
            int notifyMask = convertMask(eventMask);
            FileInfo finfo = new FileInfo(file, handle, notifyMask, recursive);
            fileMap.put(file, finfo);
            handleMap.put(handle, finfo);
View Full Code Here

            // Existing port is returned
            port = klib.CreateIoCompletionPort(handle, port, handle.getPointer(), 0);
            if (Kernel32.INVALID_HANDLE_VALUE.equals(port)) {
                throw new IOException("Unable to create/use I/O Completion port "
                        + "for " + file + " ("
                        + klib.GetLastError() + ")");
            }
            // TODO: use FileIOCompletionRoutine callback method instead of a
            // dedicated thread
            if (!klib.ReadDirectoryChangesW(handle, finfo.info, finfo.info.size(),
                                            recursive, notifyMask, finfo.infoLength,
View Full Code Here

            // TODO: use FileIOCompletionRoutine callback method instead of a
            // dedicated thread
            if (!klib.ReadDirectoryChangesW(handle, finfo.info, finfo.info.size(),
                                            recursive, notifyMask, finfo.infoLength,
                                            finfo.overlapped, null)) {
                int err = klib.GetLastError();
                throw new IOException("ReadDirectoryChangesW failed on "
                                      + finfo.file
                                      + ": '" + getSystemError(err)
                                      + "' (" + err + ")");
            }
View Full Code Here

           
            if (!klib.ReadDirectoryChangesW(finfo.handle, finfo.info,
                                            finfo.info.size(), finfo.recursive,
                                            finfo.notifyMask, finfo.infoLength,
                                            finfo.overlapped, null)) {
                int err = klib.GetLastError();
                throw new IOException("ReadDirectoryChangesW failed on "
                                      + finfo.file + ": '"
                                      + getSystemError(err)
                                      + "' (" + err + ")");
            }
View Full Code Here

                                            Kernel32.FILE_LIST_DIRECTORY,
                                            mask, null, Kernel32.OPEN_EXISTING,
                                            flags, null);
            if (Kernel32.INVALID_HANDLE_VALUE.equals(handle)) {
                throw new IOException("Unable to open " + file + " ("
                                      + klib.GetLastError() + ")");
            }
            int notifyMask = convertMask(eventMask);
            FileInfo finfo = new FileInfo(file, handle, notifyMask, recursive);
            fileMap.put(file, finfo);
            handleMap.put(handle, finfo);
View Full Code Here

            // Existing port is returned
            port = klib.CreateIoCompletionPort(handle, port, handle.getPointer(), 0);
            if (Kernel32.INVALID_HANDLE_VALUE.equals(port)) {
                throw new IOException("Unable to create/use I/O Completion port "
                        + "for " + file + " ("
                        + klib.GetLastError() + ")");
            }
            // TODO: use FileIOCompletionRoutine callback method instead of a
            // dedicated thread
            if (!klib.ReadDirectoryChangesW(handle, finfo.info, finfo.info.size(),
                                            recursive, notifyMask, finfo.infoLength,
View Full Code Here

            // TODO: use FileIOCompletionRoutine callback method instead of a
            // dedicated thread
            if (!klib.ReadDirectoryChangesW(handle, finfo.info, finfo.info.size(),
                                            recursive, notifyMask, finfo.infoLength,
                                            finfo.overlapped, null)) {
                int err = klib.GetLastError();
                throw new IOException("ReadDirectoryChangesW failed on "
                                      + finfo.file + ", handle " + handle
                                      + ": '" + getSystemError(err)
                                      + "' (" + err + ")");
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.