Changeset 2504

Show
Ignore:
Timestamp:
11/16/08 03:11:54 (7 weeks ago)
Author:
bzr
Message:

On Vista use GetProcessHandleFromHwnd? rather than OpenProcess? so that if NVDA is running with the uiAccess privilage, then it will be able to open processes that have administrator privilages.

Location:
trunk
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • trunk

    • Property bzr:revision-info
      •  

        old new  
        1 timestamp: 2008-11-15 16:15:36.749000072 +0100 
        2 committer: Peter Vágner <peter.v@datagate.sk> 
         1timestamp: 2008-11-16 14:03:55.767999887 +1100 
         2committer: Michael Curran <mick@kulgan.net> 
        33properties:  
        44        branch-nick: main 
         5        rebase-of: mick@kulgan.net-20081116030355-hlgvawwkchs8f3kw 
    • Property bzr:revision-id:v3-list-QlpoOTFBWSZTWbrL2vUAAB1VgAAQABCAQDrrnqAgAFCgaaGRkxBoTIJ6mmaNRwhndFAoNhZjh_YY4a01fOg1ulgNNC2UrzPdXXEnDpX8XckU4UJC6y9r1A..
      •  

        old new  
        2732732301 peter.v@datagate.sk-20081114162100-uy1tdrrga4msh6gd 
        2742742302 peter.v@datagate.sk-20081115151536-i58km19q3qvzcef6 
         2752303 mick@kulgan.net-20081116030355-7lzsm5jf7pzpebal 
    • Property bzr:file-ids
      •  

        old new  
        1 source/locale/cs/LC_MESSAGES/nvda.po    792@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2Flocale%2Fcs%2FLC_MESSAGES%2Fnvda.po 
        2 source/locale/es_ES/LC_MESSAGES/nvda.po 514@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2Flocale%2Fes_ES%2FLC_MESSAGES%2Fnvda.po 
        3 source/locale/gl/LC_MESSAGES/nvda.po    1363@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2Flocale%2Fgl%2FLC_MESSAGES%2Fnvda.po 
         1source/IAccessibleHandler.py    267@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2FIAccessibleHandler.py 
         2source/NVDAObjects/IAccessible/akelEdit.py      2320@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2FNVDAObjects%2FIAccessible%2FakelEdit.py 
         3source/NVDAObjects/IAccessible/edit.py  885@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2FNVDAObjects%2FIAccessible%2Fedit.py 
         4source/NVDAObjects/IAccessible/scintilla.py     829@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2FNVDAObjects%2FIAccessible%2Fscintilla.py 
         5source/NVDAObjects/IAccessible/sysListView32.py 683@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2FNVDAObjects%2FIAccessible%2FsysListView32.py 
         6source/appModules/miranda32.py  1236@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2FappModules%2Fmiranda32.py 
         7source/appModules/winamp.py     1059@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2FappModules%2Fwinamp.py 
  • trunk/source/IAccessibleHandler.py

    r2420 r2504  
    164164import JABHandler 
    165165import eventHandler 
     166import winKernel 
    166167import winUser 
    167168import speech 
     
    11031104                attribsDict[key] = tmp 
    11041105        return attribsDict 
     1106 
     1107def getProcessHandleFromHwnd(windowHandle): 
     1108        """Retreaves a process handle of the process who owns the window. 
     1109        If Windows Vista, uses GetProcessHandleFromHwnd found in oleacc.dll which allows a client with UIAccess to open a process who is elevated. 
     1110        if older than Windows Vista, just uses OpenProcess from user32.dll instead. 
     1111        @param windowHandle: a window of a process you wish to retreave a process handle for 
     1112        @type windowHandle: integer 
     1113        @returns: a process handle with read, write and operation access 
     1114        @rtype: integer 
     1115        """ 
     1116        try: 
     1117                return oledll.oleacc.GetProcessHandleFromHwnd(windowHandle) 
     1118        except: 
     1119                return winKernel.openProcess(winKernel.PROCESS_VM_READ|winKernel.PROCESS_VM_WRITE|winKernel.PROCESS_VM_OPERATION,False,winUser.getWindowThreadProcessID(windowHandle)[0]) 
  • trunk/source/NVDAObjects/IAccessible/akelEdit.py

    r2320 r2504  
    55 
    66import edit 
     7import IAccessibleHandler 
    78import winUser 
    89import winKernel 
     
    7677                super(edit.Edit,self).__init__(*args,**kwargs) 
    7778                self.TextInfo=AkelEditTextInfo 
    78                 self.editProcessHandle=winKernel.openProcess(winKernel.PROCESS_VM_OPERATION|winKernel.PROCESS_VM_READ|winKernel.PROCESS_VM_WRITE,False,self.windowProcessID) 
     79                self.editProcessHandle=IAccessibleHandler.getProcessHandleFromHwnd(self.windowHandle) 
    7980 
    8081        def __del__(self): 
  • trunk/source/NVDAObjects/IAccessible/edit.py

    r2436 r2504  
    687687                else: 
    688688                        self.TextInfo=EditTextInfo 
    689                 self.editProcessHandle=winKernel.openProcess(winKernel.PROCESS_VM_OPERATION|winKernel.PROCESS_VM_READ|winKernel.PROCESS_VM_WRITE,False,self.windowProcessID) 
     689                self.editProcessHandle=IAccessibleHandler.getProcessHandleFromHwnd(self.windowHandle) 
    690690 
    691691        def __del__(self): 
  • trunk/source/NVDAObjects/IAccessible/scintilla.py

    r2436 r2504  
    11import ctypes 
     2import IAccessibleHandler 
    23import speech 
    34import textHandler 
     
    197198                self._lastMouseTextOffsets=None 
    198199                super(Scintilla,self).__init__(*args,**kwargs) 
    199                 self.processHandle=winKernel.openProcess(winKernel.PROCESS_VM_OPERATION|winKernel.PROCESS_VM_READ|winKernel.PROCESS_VM_WRITE,False,self.windowProcessID) 
     200                self.processHandle=IAccessibleHandler.getProcessHandleFromHwnd(self.windowHandle) 
    200201 
    201202        def __del__(self): 
  • trunk/source/NVDAObjects/IAccessible/sysListView32.py

    r2242 r2504  
    88from ctypes import * 
    99from ctypes.wintypes import * 
     10import IAccessibleHandler 
    1011import controlTypes 
    1112import speech 
     
    102103def getListGroupInfo(windowHandle,groupIndex): 
    103104        (processID,threadID)=winUser.getWindowThreadProcessID(windowHandle) 
    104         processHandle=winKernel.openProcess(winKernel.PROCESS_VM_OPERATION|winKernel.PROCESS_VM_READ|winKernel.PROCESS_VM_WRITE,False,processID) 
     105        processHandle=IAccessibleHandler.getProcessHandleFromHwnd(windowHandle) 
    105106        localInfo=LVGROUP() 
    106107        localInfo.cbSize=sizeof(LVGROUP) 
  • trunk/source/appModules/miranda32.py

    r2498 r2504  
    77from ctypes import * 
    88from ctypes.wintypes import * 
     9import IAccessibleHandler 
    910import winKernel 
    1011import winUser 
     
    9293        def __init__(self,*args,**kwargs): 
    9394                super(mirandaIMContactList,self).__init__(*args,**kwargs) 
    94                 self.processHandle=winKernel.openProcess(winKernel.PROCESS_VM_OPERATION|winKernel.PROCESS_VM_READ|winKernel.PROCESS_VM_WRITE,False,self.windowProcessID) 
     95                self.processHandle=IAccessibleHandler.getProcessHandleFromHwnd(self.windowHandle) 
    9596 
    9697        def __del__(self): 
  • trunk/source/appModules/winamp.py

    r2498 r2504  
    77from ctypes import * 
    88from ctypes.wintypes import * 
     9import IAccessibleHandler 
    910import winKernel 
    1011import winUser 
     
    9192        def __init__(self,*args,**kwargs): 
    9293                super(winampPlaylistEditor,self).__init__(*args,**kwargs) 
    93                 self.processHandle=winKernel.openProcess(winKernel.PROCESS_VM_OPERATION|winKernel.PROCESS_VM_READ|winKernel.PROCESS_VM_WRITE,False,self.windowProcessID) 
     94                self.processHandle=IAccessibleHandler.getProcessHandleFromHwnd(self.windowHandle) 
    9495 
    9596        def __del__(self):