Jump to content

.Net Change Processor Affinity to 0x000F?

Hatsune Miku 「 」
Go to solution Solved by madknight3,

I'm just guessing here but maybe this will work.

 

Given that (0x000f)16 = (15)10 and given the code sample here, try

process.ProcessorAffinity = CType(15, IntPtr)

Hi for an API I'm working on, how do I parse the processor affinity of F or 0x000F to process.ProcessorAffinity - new IntPtr(F) as it has to take a valid integer?

"Instinct or Rationality; Which will you choose? Enchanted by a superiority complex"

"what you do in spite of internet speed is inspiring. :3" From Cae - 2015

Link to comment
Share on other sites

Link to post
Share on other sites

I'm just guessing here but maybe this will work.

 

Given that (0x000f)16 = (15)10 and given the code sample here, try

process.ProcessorAffinity = CType(15, IntPtr)
Link to comment
Share on other sites

Link to post
Share on other sites

 

I'm just guessing here but maybe this will work.

 

Given that (0x000f)16 = (15)10 and given the code sample here, try

process.ProcessorAffinity = CType(15, IntPtr)

Thank you. Works perfectly.

"Instinct or Rationality; Which will you choose? Enchanted by a superiority complex"

"what you do in spite of internet speed is inspiring. :3" From Cae - 2015

Link to comment
Share on other sites

Link to post
Share on other sites

Usually compilers will interpret integers as hex if you put 0x in front of them.

 

 

new IntPtr(0x0f) would probably work

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×