Package com.sun.jna.platform.win32

Examples of com.sun.jna.platform.win32.Kernel32$OVERLAPPED_COMPLETION_ROUTINE


        protected synchronized void unwatch(File file) {
            FileInfo finfo = (FileInfo)fileMap.remove(file);
            if (finfo != null) {
                handleMap.remove(finfo.handle);
                Kernel32 klib = Kernel32.INSTANCE;
                klib.CloseHandle(finfo.handle);
            }
        }
View Full Code Here


            int i = 0;
            for (Object[] keys = fileMap.keySet().toArray(); !fileMap.isEmpty();) {
                unwatch((File)keys[i++]);
            }
           
            Kernel32 klib = Kernel32.INSTANCE;
            klib.PostQueuedCompletionStatus(port, 0, null, null);
            klib.CloseHandle(port);
            port = null;
            watcher = null;
        }
View Full Code Here

            klib.CloseHandle(port);
            port = null;
            watcher = null;
        }
        private String getSystemError(int code) {
            Kernel32 lib = Kernel32.INSTANCE;
            PointerByReference pref = new PointerByReference();
            lib.FormatMessage(Kernel32.FORMAT_MESSAGE_ALLOCATE_BUFFER
                              |Kernel32.FORMAT_MESSAGE_FROM_SYSTEM
                              |Kernel32.FORMAT_MESSAGE_IGNORE_INSERTS,
                              null, code,
                              0, pref, 0, null);
            String s = pref.getValue().getString(0, !Boolean.getBoolean("w32.ascii"));
            s = s.replace(".\r",".").replace(".\n",".");
            lib.LocalFree(pref.getValue());
            return s;
        }
View Full Code Here

        private Map fileMap = new HashMap();
        private Map handleMap = new HashMap();
       
        private void handleChanges(FileInfo finfo) throws IOException {
            Kernel32 klib = Kernel32.INSTANCE;
            FILE_NOTIFY_INFORMATION fni = finfo.info;
            // Need an explicit read, since data was filled in asynchronously
            fni.read();
            do {
                FileEvent event = null;
                File file = new File(finfo.file, fni.getFilename());
                switch(fni.Action) {
                case Kernel32.FILE_ACTION_MODIFIED:
                    event = new FileEvent(file, FILE_MODIFIED); break;
                case Kernel32.FILE_ACTION_ADDED:
                    event = new FileEvent(file, FILE_CREATED); break;
                case Kernel32.FILE_ACTION_REMOVED:
                    event = new FileEvent(file, FILE_DELETED); break;
                case Kernel32.FILE_ACTION_RENAMED_OLD_NAME:
                    event = new FileEvent(file, FILE_NAME_CHANGED_OLD); break;
                case Kernel32.FILE_ACTION_RENAMED_NEW_NAME:
                    event = new FileEvent(file, FILE_NAME_CHANGED_NEW); break;
                default:
                    // TODO: other actions...
                    System.err.println("Unrecognized file action '" + fni.Action + "'");
                }
                if (event != null)
                    notify(event);
                fni = fni.next();
            } while (fni != null);
            // Trigger the next read
            if (!finfo.file.exists()) {
                unwatch(finfo.file);
                return;
View Full Code Here

        private final Map fileMap = new HashMap();
        private final Map handleMap = new HashMap();
       
        private void handleChanges(FileInfo finfo) throws IOException {
            Kernel32 klib = Kernel32.INSTANCE;
            FILE_NOTIFY_INFORMATION fni = finfo.info;
            // Need an explicit read, since data was filled in asynchronously
            fni.read();
            do {
                FileEvent event = null;
                File file = new File(finfo.file, fni.getFilename());
                switch(fni.Action) {
                case Kernel32.FILE_ACTION_MODIFIED:
                    event = new FileEvent(file, FILE_MODIFIED); break;
                case Kernel32.FILE_ACTION_ADDED:
                    event = new FileEvent(file, FILE_CREATED); break;
                case Kernel32.FILE_ACTION_REMOVED:
                    event = new FileEvent(file, FILE_DELETED); break;
                case Kernel32.FILE_ACTION_RENAMED_OLD_NAME:
                    event = new FileEvent(file, FILE_NAME_CHANGED_OLD); break;
                case Kernel32.FILE_ACTION_RENAMED_NEW_NAME:
                    event = new FileEvent(file, FILE_NAME_CHANGED_NEW); break;
                default:
                    // TODO: other actions...
                    System.err.println("Unrecognized file action '" + fni.Action + "'");
                }
                if (event != null)
                    notify(event);
                fni = fni.next();
            } while (fni != null);
            // Trigger the next read
            if (!finfo.file.exists()) {
                unwatch(finfo.file);
                return;
View Full Code Here

        this.createPackageName(packagename);
        this.createClassName(this.name);
        this.setFilename(this.name);

        // Get the TypeAttributes
        TypeInfoUtil typeInfoUtil = typeLibUtil.getTypeInfoUtil(index);
        TYPEATTR typeAttr = typeInfoUtil.getTypeAttr();

        this.createJavaDocHeader(typeAttr.guid.toGuidString(), docString);

        int cFuncs = typeAttr.cFuncs.intValue();
        for (int i = 0; i < cFuncs; i++) {
            // Get the function description
            FUNCDESC funcDesc = typeInfoUtil.getFuncDesc(i);

            // Get the member ID
            MEMBERID memberID = funcDesc.memid;

            // Get the name of the method
            TypeInfoDoc typeInfoDoc2 = typeInfoUtil.getDocumentation(memberID);
            String methodName = typeInfoDoc2.getName();
            TlbAbstractMethod method = null;

            if (!isReservedMethod(methodName)) {
                if (funcDesc.invkind.equals(INVOKEKIND.INVOKE_FUNC)) {
                    method = new TlbFunctionStub(index, typeLibUtil, funcDesc,
                            typeInfoUtil);
                } else if (funcDesc.invkind
                        .equals(INVOKEKIND.INVOKE_PROPERTYGET)) {
                    method = new TlbPropertyGetStub(index, typeLibUtil,
                            funcDesc, typeInfoUtil);
                } else if (funcDesc.invkind
                        .equals(INVOKEKIND.INVOKE_PROPERTYPUT)) {
                    method = new TlbPropertyPutStub(index, typeLibUtil,
                            funcDesc, typeInfoUtil);
                } else if (funcDesc.invkind
                        .equals(INVOKEKIND.INVOKE_PROPERTYPUTREF)) {
                    method = new TlbPropertyPutStub(index, typeLibUtil,
                            funcDesc, typeInfoUtil);
                }

                this.content += method.getClassBuffer();

                if (i < cFuncs - 1)
                    this.content += CR;
            }

            // Release our function description stuff
            typeInfoUtil.ReleaseFuncDesc(funcDesc);
        }

        this.createContent(this.content);
    }
View Full Code Here

        this.createPackageName(packagename);
        this.createClassName(this.name);
        this.setFilename(this.name);

        // Get the TypeAttributes
        TypeInfoUtil typeInfoUtil = typeLibUtil.getTypeInfoUtil(index);
        TYPEATTR typeAttr = typeInfoUtil.getTypeAttr();

        this.createJavaDocHeader(typeAttr.guid.toGuidString(), docString);

        int cVars = typeAttr.cVars.intValue();
        for (int i = 0; i < cVars; i++) {
            // Get the property description
            VARDESC varDesc = typeInfoUtil.getVarDesc(i);
            VARIANT constValue = varDesc._vardesc.lpvarValue;
            Object value = constValue.getValue();

            // Get the member ID
            MEMBERID memberID = varDesc.memid;

            // Get the name of the property
            TypeInfoDoc typeInfoDoc2 = typeInfoUtil.getDocumentation(memberID);
            this.content += TABTAB + "//" + typeInfoDoc2.getName() + CR;
            this.content += TABTAB + "public static final int "
                    + typeInfoDoc2.getName() + " = " + value.toString() + ";";

            if (i < cVars - 1)
                this.content += CR;

            // release the pointer
            typeInfoUtil.ReleaseVarDesc(varDesc);
        }

        this.createContent(this.content);
    }
View Full Code Here

            // Get the member ID
            MEMBERID memberID = varDesc.memid;

            // Get the name of the property
            TypeInfoDoc typeInfoDoc2 = typeInfoUtil.getDocumentation(memberID);
            this.content += TABTAB + "//" + typeInfoDoc2.getName() + CR;
            this.content += TABTAB + "public static final int "
                    + typeInfoDoc2.getName() + " = " + value.toString() + ";";

            if (i < cVars - 1)
                this.content += CR;
        }
View Full Code Here

            // Get the member ID
            MEMBERID memberID = funcDesc.memid;

            // Get the name of the method
            TypeInfoDoc typeInfoDoc2 = typeInfoUtil.getDocumentation(memberID);
            String methodName = typeInfoDoc2.getName();
            TlbAbstractMethod method = null;

            if (!isReservedMethod(methodName)) {
                if (funcDesc.invkind.equals(INVOKEKIND.INVOKE_FUNC)) {
                    method = new TlbFunctionStub(index, typeLibUtil, funcDesc,
View Full Code Here

            // Get the member ID
            MEMBERID memberID = varDesc.memid;

            // Get the name of the property
            TypeInfoDoc typeInfoDoc2 = typeInfoUtil.getDocumentation(memberID);
            this.content += TABTAB + "//" + typeInfoDoc2.getName() + CR;
            this.content += TABTAB + "public static final int "
                    + typeInfoDoc2.getName() + " = " + value.toString() + ";";

            if (i < cVars - 1)
                this.content += CR;

            // release the pointer
View Full Code Here

TOP

Related Classes of com.sun.jna.platform.win32.Kernel32$OVERLAPPED_COMPLETION_ROUTINE

Copyright © 2018 www.massapicom. 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.