Could Not Duplicate Handle Error 6
Contents |
Custom training mixed with consulting and focused directly on your specific areas of interest/concern. Check us out. OSR, the Windows driver experts. OSR Online Lists > windbg !handle Welcome, Guest You must login to post to this list Message 1 of 8 26 Jan 0916:21 duplicatehandle windbg member 39587 xxxxxx@verdasys.com Join Date: Posts To This List: 37 !handle Hi, I always seem
Getcurrentprocess
to get "error 6" no matter what handle I pass to !handle. This is in at least the last two version of windbg, talking
Openprocess
to a vmware vm. Anyone else seeing these issues? Thanks, -Jeff Message 2 of 8 26 Jan 0916:27 windbg member 19758 xxxxxx@evitechnology.com Join Date: Posts To This List: 504 !handle I don't use !handle much (I assume
Getcurrentprocessid
you mean kernel mode), but I just tried it, and it appears to work (plausible output at least) on 6.10.3.233 connection to 6001 x86_64 chk (not vm). mm Jeff Curless wrote: > Hi, > > I always seem to get "error 6" no matter what handle I pass to !handle. This is in at least the last two version of windbg, talking to a vmware vm. Anyone else seeing these issues? > > Thanks, > -Jeff > Message 3 of 8 26 Jan 0916:28 Scott Noone xxxxxx@osr.com Join Date: 10 Jul 2002 Posts To This List: 528 List Moderator !handle I use it often enough and I've never had a problem with it. What's the command you're using? -scott -- Scott Noone Software Engineer OSR Open Systems Resources, Inc. http://www.osronline.com "Martin O'Brien"
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up DuplicateHandle error: error_invalid_handle up vote 1 down vote favorite 1 I'm trying to pass a http://www.osronline.com/ShowThread.cfm?link=148461 handle from process1 to process2 using the DuplicateHandle function. I obtain the handle using the CreateFile function: HANDLE COMportHandle; COMportHandle = CreateFile(TEXT("COM5"), GENERIC_ALL | PROCESS_DUP_HANDLE, 0, 0, OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL, 0); In the second process, I first obtain the process ID from process1 through shared memory, and then try to duplicate the handle: HANDLE pr1handle, CPH, COMportHandle; pr1handle = OpenProcess(PROCESS_DUP_HANDLE,FALSE,process_id); if(!DuplicateHandle(pr1handle,COMportHandle,GetCurrentProcess(),&CPH,PROCESS_DUP_HANDLE,FALSE,0)) printf("Error: %d\n",GetLastError()); Then I get the ERROR_INVALID_HANDLE. The processes are not related, http://stackoverflow.com/questions/14500232/duplicatehandle-error-error-invalid-handle I run the first to open the COM port, and then want to be able to read from it with the second process. Can somebody tell me where the catch is? c++ windows handle share|improve this question edited Jan 24 '13 at 11:49 Adri C.S. 1,36421541 asked Jan 24 '13 at 11:26 user2007080 82 1 Um, PROCESS_DUP_HANDLE is not a valid access mask for file handles. It is meaningful only for process handles. –Raymond Chen Jan 24 '13 at 13:17 Never skip error checking, surely OpenProcess() failed. –Hans Passant Jan 24 '13 at 14:09 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote accepted In this code here: HANDLE pr1handle, CPH, COMportHandle; pr1handle = OpenProcess(PROCESS_DUP_HANDLE,FALSE,process_id); if(!DuplicateHandle(pr1handle,COMportHandle,GetCurrentProcess(),&CPH,PROCESS_DUP_HANDLE,FALSE,0)) printf("Error: %d\n",GetLastError()); you introduce a new, uninitialized COMportHandle. So, assuming this is the actual code, I'm not at all surprised COMportHandle is invalid". You will somehow need to get the actual value of COMportHandle from your first process. share|improve this answer answered Jan 24 '13 at 11:32 Mats Petersson 94.4k754134 I thought that's what the DuplicateHandle function does. If I could get the actual value from the first process in another way, I wouldn't be using this function at all. Do you maybe have a
12.1 - Where is the "History/Empty" button? Rotating Past Down Why can't AVEVA support Upgrade of PDMS http://www.avevaworldforum.com/forum/archive/index.php/f-70-p-3.html lower versions(11.3/11.6) directly to 12.1 Positioning Control vs. PML administrator for designer Connect Two branches of pipe Logical UDA MODIFY dra-genadp-piping Change color permanent? Database write access issue - global project Question about http://www.kernelmode.info/forum/viewtopic.php?f=10&t=4179 global project Database management Global project issues Bar and menu customization Looking for the book of PDMS FOR DUMMIES spooler comand spooling add About PDMS 12 Search Utility How to use quick could not report to get pipe bore Hangeres and supports problem with PDMS 12.1 CABLE TRAY SPEC issue Text placement problems exporting to dxf Issue for login PDMS spool breaked without reference How to add a project to foreign project list? From 11.5 to 12 help me project name in PDMS ERROR Run PDMS Error in Draft symbol libraries DBlisting Paragon error when create or modify NOMTAB AVEVA could not duplicate 12.1 Font Problem Draft Transfering SITES to TEST DB nwd 2 PDMS Local Master DBs in PDMS 12 DRAFT PIC FILES Are getting deleted How to remove existing project in "Project Creation Wizard" PDMS Cabling system module Problem with representation of russian values in attributes opening circular platform System iso issue Error ASL Structure error 406 Syscom question Insufficient Access Rights on a Datum MDS/option does not exist Running PDMS Ver12 from x64bit Serveron Client Machine In PDMS 12, how to restore approved clashes list created in PDMS 11.6? How to fix error (bug?) in using Save View? Problem for Insulation in Draft Fatal splash Error in PDMS 12.0 sp5 Export Bill Of Material - Piping System Error while opening PMDS Change Font HELP on PML .net fundamentals LEXICON - Strange window layout!? Interview questions ragarding pdms how to change the color of the equipments,pipes in draft. How to check status of PIPE from a component Lisega PMLLIB error Export Files run PDMS batch Upgrade PDMS 11.5 to PDMS 12.0 How to control origin of Texp by C# Level gauge How to outcom an attribute of Spref on iso drawing Everything 3D Draft Macro
All times are UTC Powered by phpBB Forum Software © phpBB Group