Package com.sun.jna

Examples of com.sun.jna.Pointer


         *
         * @param pointer
         *            the pointer
         */
        public DEV_BROADCAST_DEVICEINTERFACE(long pointer) {
            this(new Pointer(pointer));
        }
View Full Code Here


     * Return a procedure function pointer
     * @param procName the procedure name
     * @return the function
     */
    public static Function wglGetProcAddress(String procName) {
        Pointer funcPointer = OpenGL32.INSTANCE.wglGetProcAddress("wglEnumGpusNV");
        return (funcPointer == null) ? null : Function.getFunction(funcPointer);
    }
View Full Code Here

        GDI32.INSTANCE.SetPixelFormat(hdc, GDI32.INSTANCE.ChoosePixelFormat(hdc, pfd), pfd);

        // create the OpenGL context to get function address
        WinDef.HGLRC hGLRC = OpenGL32.INSTANCE.wglCreateContext(hdc);
        OpenGL32.INSTANCE.wglMakeCurrent(hdc, hGLRC);
        Pointer funcPointer = OpenGL32.INSTANCE.wglGetProcAddress("wglEnumGpusNV");
        Function fncEnumGpusNV = (funcPointer == null) ? null : Function.getFunction(funcPointer);
        OpenGL32.INSTANCE.wglDeleteContext(hGLRC);

        // destroy the window
        User32.INSTANCE.ReleaseDC(hWnd, hdc);
View Full Code Here

public interface WinReg extends StdCallLibrary {
 
    public static class HKEY extends HANDLE {
        public HKEY() { }
        public HKEY(Pointer p) { super(p); }
        public HKEY(int value) { super(new Pointer(value)); }
View Full Code Here

        public void setValue(HKEY h) {
            getPointer().setPointer(0, h != null ? h.getPointer() : null);
        }
       
        public HKEY getValue() {
            Pointer p = getPointer().getPointer(0);
            if (p == null)
                return null;
            if (WinBase.INVALID_HANDLE_VALUE.getPointer().equals(p))
                return (HKEY) WinBase.INVALID_HANDLE_VALUE;
            HKEY h = new HKEY();
View Full Code Here

   * @throws java.lang.Exception
   */
  public boolean install(String displayName, String description, String[] dependencies, String account, String password, String command) {
    Advapi32 advapi32;
    Advapi32.SERVICE_DESCRIPTION desc;
    Pointer serviceManager, service;
    boolean success = false;
    String dep = "";
   
    if(dependencies != null) {
      for(String s : dependencies) {
View Full Code Here

   * @throws java.lang.Exception
   * @return true on success
   */
  public boolean uninstall() {
    Advapi32 advapi32;
    Pointer serviceManager, service;
    boolean success = false;
   
    advapi32 = Advapi32.INSTANCE;
    serviceManager = openServiceControlManager(null, WINSVC.SC_MANAGER_ALL_ACCESS);
   
View Full Code Here

   * Ask the ServiceControlManager to start the service.
   * @return true on success
   */
  public boolean start() {
    Advapi32 advapi32;
    Pointer serviceManager, service;
    boolean success = false;
   
    advapi32 = Advapi32.INSTANCE;
   
    serviceManager = openServiceControlManager(null, WINNT.GENERIC_EXECUTE);
View Full Code Here

   * Ask the ServiceControlManager to stop the service.
   * @return true on success
   */
  public boolean stop() throws Exception {
    Advapi32 advapi32;
    Pointer serviceManager, service;
    Advapi32.SERVICE_STATUS serviceStatus;
    boolean success = false;
   
    advapi32 = Advapi32.INSTANCE;
   
View Full Code Here

   * @param machine name of the machine or null for localhost
   * @param access access flags
   * @return handle to ServiceControlManager or null when failed
   */
  private Pointer openServiceControlManager(String machine, int access) {
    Pointer handle = null;
    Advapi32 advapi32;
   
    advapi32 = Advapi32.INSTANCE;
    handle = advapi32.OpenSCManager(machine, null, access);
    return(handle);
View Full Code Here

TOP

Related Classes of com.sun.jna.Pointer

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.