how to call gettokeninformation() api function? 
Author Message
 how to call gettokeninformation() api function?

has anyone had any luck with calling gettokeninformation() api function
from within vb? i either got error_insufficient_buffer (122) or crash on

access violation exception.

what i wanted to do is to check if the current log on user is in a given

group. i found the c code given by ms, but was thinking whether the same

thing can be done in vb/vba.

i am using nt 4.0 (sp 3), vs 6.0 ee.

any tips will be appreciated.

keyuan jiang



Tue, 27 Mar 2001 03:00:00 GMT  
 how to call gettokeninformation() api function?
Hi Keyuan --

Quote:
>has anyone had any luck with calling gettokeninformation() api function
>from within vb? i either got error_insufficient_buffer (122) or crash on

Heh, sounds like you need a bigger buffer. <g>

Quote:
>what i wanted to do is to check if the current log on user is in a given group.

Grab the NetUser.zip sample at http://www.mvps.org/vb

Later...   Karl



Tue, 27 Mar 2001 03:00:00 GMT  
 how to call gettokeninformation() api function?

Karl,

thanks for your prompt note.

Quote:
>  Heh, sounds like you need a bigger buffer. <g>

well, after learning the meaning of error 122 (from getlasterror()),
i call gettokeninformation() twice. first time it returns the buffer
size it requires, and before calling it the second time, i use
globalalloc() with the returned size to create a new buffer.

Quote:
> Grab the NetUser.zip sample at http://www.mvps.org/vb

thanks for the tip, but this not what wanted. i'd like to know whether
a domain user belongs to a domain group. i've looked at netget...
functions and don't think they can be used in my case.

btw, i didn't seem to remember seeing the tip in vbpj. do you know
if vbpj has a searchable index on web? this will be very helpful.

best regards,

keyuan



Tue, 27 Mar 2001 03:00:00 GMT  
 how to call gettokeninformation() api function?
Hi Keyuan --

Quote:
>>  Heh, sounds like you need a bigger buffer. <g>

>well, after learning the meaning of error 122 (from getlasterror()),
>i call gettokeninformation() twice. first time it returns the buffer
>size it requires, and before calling it the second time, i use
>globalalloc() with the returned size to create a new buffer.

Good strategy (though, odds are, a byte array would do just fine?)

Quote:
>btw, i didn't seem to remember seeing the tip in vbpj. do you know
>if vbpj has a searchable index on web? this will be very helpful.

Their search engine sucks, to be honest.  It's a limitation with the particular MS
software that they're using, afaik.  But there are plans to update it over the next
few weeks, from what I've heard.

Later...   Karl



Tue, 27 Mar 2001 03:00:00 GMT  
 how to call gettokeninformation() api function?


Fri, 19 Jun 1992 00:00:00 GMT  
 how to call gettokeninformation() api function?
Karl,

You seem to know your way around the APIs and other nice features.

I have some code I found a while back that will ID INTEL only CPUs.

Do you know where/how to ID the others?

This would include all flavors from 486 and up.

Thanks in advance,

Chris
--
                             ''~``
                            (\o-o/)
 +---------------------.oooO--(_)--Oooo.---------------------+

 | Voice/FAX    : 512-832-0638| www.io.com/~cape/pricelst.htm|
 | ICQ          : 12547628                                   |
 |-----------------------------------------------------------|
 |Where service is more than a just a word It's a way of life|
 |                      .oooO                                |
 |                      (   )   Oooo.                        |
 +-----------------------\ (----(   )------------------------+
                          \_)   ) /
                               (_/



Thu, 29 Mar 2001 03:00:00 GMT  
 how to call gettokeninformation() api function?
I had my processor identified as "GenuineIntel" with the
ENVIRON("PROCESSOR_IDENTIFIER") statement.

William Timbrook
Seattle FilmWorks

Quote:

>Karl,

>You seem to know your way around the APIs and other nice features.

>I have some code I found a while back that will ID INTEL only CPUs.

>Do you know where/how to ID the others?

>This would include all flavors from 486 and up.

>Thanks in advance,

>Chris
>--
>                             ''~``
>                            (\o-o/)
> +---------------------.oooO--(_)--Oooo.---------------------+

> | Voice/FAX    : 512-832-0638| www.io.com/~cape/pricelst.htm|
> | ICQ          : 12547628                                   |
> |-----------------------------------------------------------|
> |Where service is more than a just a word It's a way of life|
> |                      .oooO                                |
> |                      (   )   Oooo.                        |
> +-----------------------\ (----(   )------------------------+
>                          \_)   ) /
>                               (_/



Fri, 30 Mar 2001 03:00:00 GMT  
 how to call gettokeninformation() api function?
But it doesn't tell me what speed, etc.

I need the "whole enchilada"...

Quote:

> I had my processor identified as "GenuineIntel" with the
> ENVIRON("PROCESSOR_IDENTIFIER") statement.

> William Timbrook
> Seattle FilmWorks


> >Karl,

> >You seem to know your way around the APIs and other nice features.

> >I have some code I found a while back that will ID INTEL only CPUs.

> >Do you know where/how to ID the others?

> >This would include all flavors from 486 and up.

> >Thanks in advance,

> >Chris
> >--
> >                             ''~``
> >                            (\o-o/)
> > +---------------------.oooO--(_)--Oooo.---------------------+

> > | Voice/FAX    : 512-832-0638| www.io.com/~cape/pricelst.htm|
> > | ICQ          : 12547628                                   |
> > |-----------------------------------------------------------|
> > |Where service is more than a just a word It's a way of life|
> > |                      .oooO                                |
> > |                      (   )   Oooo.                        |
> > +-----------------------\ (----(   )------------------------+
> >                          \_)   ) /
> >                               (_/

--

    The views expressed herein are not necessarily that of IBMs
    but are of my own.

            ________   ___   ____
           / __   __| / _ \ |  _ \
     ______> \ | |   |  _  ||    /_____________________________
    / _______/ |_|   |_| |_||_|\______________________________ \
   / /                                                        \ \
  | |                                                          | |
  | | Chris Anderson                 AIX Product Test          | |

  | | VM : CDA at AUSVM6             RISC System/6000 Division | |
  | | 512-838-4834 / T/L 678-4834    Austin, Texas             | |
  | |                                                          | |
   \ \____________________________    _   ___   ____   _______/ /
    \___________________________  |  | | / _ \ |  _ \ / _______/
                                | |/\| ||  _  ||    /_> \
                                 \_/\_/ |_| |_||_|\_____/



Fri, 30 Mar 2001 03:00:00 GMT  
 how to call gettokeninformation() api function?
Hi

Try the registry
Registry Key is
HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0

Values are      Identifier
                VendorIdentifier
                ~MHZ

Note the last will give a hex number that translates to the speed of the
processor, give or take 1Mhz

Regards

Neal



Quote:
>But it doesn't tell me what speed, etc.

>I need the "whole enchilada"...


>> I had my processor identified as "GenuineIntel" with the
>> ENVIRON("PROCESSOR_IDENTIFIER") statement.

>> William Timbrook
>> Seattle FilmWorks


>> >Karl,

>> >You seem to know your way around the APIs and other nice features.

>> >I have some code I found a while back that will ID INTEL only CPUs.

>> >Do you know where/how to ID the others?

>> >This would include all flavors from 486 and up.

>> >Thanks in advance,

>> >Chris
>> >--
>> >                             ''~``
>> >                            (\o-o/)
>> > +---------------------.oooO--(_)--Oooo.---------------------+

>> > | Voice/FAX    : 512-832-0638| www.io.com/~cape/pricelst.htm|
>> > | ICQ          : 12547628                                   |
>> > |-----------------------------------------------------------|
>> > |Where service is more than a just a word It's a way of life|
>> > |                      .oooO                                |
>> > |                      (   )   Oooo.                        |
>> > +-----------------------\ (----(   )------------------------+
>> >                          \_)   ) /
>> >                               (_/

>--

>    The views expressed herein are not necessarily that of IBMs
>    but are of my own.

>            ________   ___   ____
>           / __   __| / _ \ |  _ \
>     ______> \ | |   |  _  ||    /_____________________________
>    / _______/ |_|   |_| |_||_|\______________________________ \
>   / /                                                        \ \
>  | |                                                          | |
>  | | Chris Anderson                 AIX Product Test          | |

>  | | VM : CDA at AUSVM6             RISC System/6000 Division | |
>  | | 512-838-4834 / T/L 678-4834    Austin, Texas             | |
>  | |                                                          | |
>   \ \____________________________    _   ___   ____   _______/ /
>    \___________________________  |  | | / _ \ |  _ \ / _______/
>                                | |/\| ||  _  ||    /_> \
>                                 \_/\_/ |_| |_||_|\_____/

--
Neal Mahfouz


Sun, 08 Apr 2001 03:00:00 GMT  
 how to call gettokeninformation() api function?
My Win 95 box only have VendorIdentifier, nothing else.

I am looking for a solution for NT, 95, 98,  etc

Chris

P.S. - Thanks, to all, for the continued effort.

Quote:

> Hi

> Try the registry
> Registry Key is
> HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0

> Values are      Identifier
>                 VendorIdentifier
>                 ~MHZ

> Note the last will give a hex number that translates to the speed of the
> processor, give or take 1Mhz

> Regards

> Neal



> >But it doesn't tell me what speed, etc.

> >I need the "whole enchilada"...


> >> I had my processor identified as "GenuineIntel" with the
> >> ENVIRON("PROCESSOR_IDENTIFIER") statement.

> >> William Timbrook
> >> Seattle FilmWorks


> >> >Karl,

> >> >You seem to know your way around the APIs and other nice features.

> >> >I have some code I found a while back that will ID INTEL only CPUs.

> >> >Do you know where/how to ID the others?

> >> >This would include all flavors from 486 and up.

> >> >Thanks in advance,

> >> >Chris
> >> >--
> >> >                             ''~``
> >> >                            (\o-o/)
> >> > +---------------------.oooO--(_)--Oooo.---------------------+

> >> > | Voice/FAX    : 512-832-0638| www.io.com/~cape/pricelst.htm|
> >> > | ICQ          : 12547628                                   |
> >> > |-----------------------------------------------------------|
> >> > |Where service is more than a just a word It's a way of life|
> >> > |                      .oooO                                |
> >> > |                      (   )   Oooo.                        |
> >> > +-----------------------\ (----(   )------------------------+
> >> >                          \_)   ) /
> >> >                               (_/

> >--

> >    The views expressed herein are not necessarily that of IBMs
> >    but are of my own.

> >            ________   ___   ____
> >           / __   __| / _ \ |  _ \
> >     ______> \ | |   |  _  ||    /_____________________________
> >    / _______/ |_|   |_| |_||_|\______________________________ \
> >   / /                                                        \ \
> >  | |                                                          | |
> >  | | Chris Anderson                 AIX Product Test          | |

> >  | | VM : CDA at AUSVM6             RISC System/6000 Division | |
> >  | | 512-838-4834 / T/L 678-4834    Austin, Texas             | |
> >  | |                                                          | |
> >   \ \____________________________    _   ___   ____   _______/ /
> >    \___________________________  |  | | / _ \ |  _ \ / _______/
> >                                | |/\| ||  _  ||    /_> \
> >                                 \_/\_/ |_| |_||_|\_____/

> --
> Neal Mahfouz

--

    The views expressed herein are not necessarily that of IBMs
    but are of my own.

            ________   ___   ____
           / __   __| / _ \ |  _ \
     ______> \ | |   |  _  ||    /_____________________________
    / _______/ |_|   |_| |_||_|\______________________________ \
   / /                                                        \ \
  | |                                                          | |
  | | Chris Anderson                 AIX Product Test          | |

  | | VM : CDA at AUSVM6             RISC System/6000 Division | |
  | | 512-838-4834 / T/L 678-4834    Austin, Texas             | |
  | |                                                          | |
   \ \____________________________    _   ___   ____   _______/ /
    \___________________________  |  | | / _ \ |  _ \ / _______/
                                | |/\| ||  _  ||    /_> \
                                 \_/\_/ |_| |_||_|\_____/



Mon, 09 Apr 2001 03:00:00 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. Calling API Functions

2. Calling Windows API functions with string parameters from Access

3. Calling Registry API functions

4. Calling a API function from VB.NET

5. CAlling TAPI API DLL functions in VB-Script

6. VB.NET and Win32 API Function Calls

7. Error in VB4 calling registry API functions

8. API Function Calls

9. API function calls

10. API : Calling function from DLLs

11. Problems after calling WaitForSingleObject and Sleep API functions

12. Why to tell which API functions are called?

 

 
Powered by phpBB® Forum Software