7 Replies - 650 Views - Last Post: 05 February 2012 - 06:49 PM Rate Topic: -----

#1 krizjaz  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 20
  • View blog
  • Posts: 99
  • Joined: 07-October 07

Get handle of 64-bit process by 32-bit app

Posted 04 February 2012 - 04:00 AM

Is it possible to get the handle of a 64-bit process by a 32-bit app? I get GetLastError 5 which is Access Denied.
Is This A Good Question/Topic? 0
  • +

Replies To: Get handle of 64-bit process by 32-bit app

#2 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5511
  • View blog
  • Posts: 11,815
  • Joined: 02-June 10

Re: Get handle of 64-bit process by 32-bit app

Posted 04 February 2012 - 07:18 AM

This might sound silly but... If you're on a 64bit OS, why don't you make a 64bit version of your application - if only to test with?

If it works then you know the answer.
If it doesn't, then you know your code is fraked someplace and you need to debug it.
Was This Post Helpful? 0
  • +
  • -

#3 krizjaz  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 20
  • View blog
  • Posts: 99
  • Joined: 07-October 07

Re: Get handle of 64-bit process by 32-bit app

Posted 04 February 2012 - 08:17 AM

Yah, i know that. I have a reason why i don't want to make it into 64-bit app. And i'm using 32-bit OS. But if in 32-bit app, is it possible?

This post has been edited by krizjaz: 04 February 2012 - 08:19 AM

Was This Post Helpful? 0
  • +
  • -

#4 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5511
  • View blog
  • Posts: 11,815
  • Joined: 02-June 10

Re: Get handle of 64-bit process by 32-bit app

Posted 04 February 2012 - 08:22 AM

Ya got me. I've never had a need.

But like I said, I'd just do my own test. I mean you already have everything set up. Just throw together a quickie test utility using the code you've already worked out.

In the time you've waited for someone else to give you the answer, you could have done the test yourself.

You don't need all of the functionality of the full application.
Just a button and a label for the response after you try to get the handle.
Was This Post Helpful? 0
  • +
  • -

#5 krizjaz  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 20
  • View blog
  • Posts: 99
  • Joined: 07-October 07

Re: Get handle of 64-bit process by 32-bit app

Posted 04 February 2012 - 10:34 AM

Was already testing it with a friend who has 64-bit and now GetLastError is giving him Invalid Handle, 6, using OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid).
Was This Post Helpful? 0
  • +
  • -

#6 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5511
  • View blog
  • Posts: 11,815
  • Joined: 02-June 10

Re: Get handle of 64-bit process by 32-bit app

Posted 04 February 2012 - 10:42 AM

What application are you trying to get the handle of?

And can we see your code for obtaining that handle?
Was This Post Helpful? 0
  • +
  • -

#7 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,281
  • Joined: 28-March 11

Re: Get handle of 64-bit process by 32-bit app

Posted 04 February 2012 - 06:45 PM

If it is for code injection, then NO a 32 bit app cannot inject/read/write into a 64 bit process AFAIK. Now, if you say "Well, it works on XP" then as a programmer, you need a slap upside the head because Vista and Windows 7 ARE NOT XP.

Does your program have the proper SE_* privileges?

Either way, there are many things a 32 bit app CANNOT do because when you run a 32 bit app on a 64 bit OS, it is not running natively but instead it is running in an emulator (WOW64)
Was This Post Helpful? 1
  • +
  • -

#8 krizjaz  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 20
  • View blog
  • Posts: 99
  • Joined: 07-October 07

Re: Get handle of 64-bit process by 32-bit app

Posted 05 February 2012 - 06:49 PM

Yah, as what it is in my mind. All i need is that answer. And that satisfies me. Thanks! So, going to the last option, make a 64-bit app. . ~sigh
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1