News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Bug In Windows.inc?

Started by remus2k, January 02, 2011, 11:51:56 PM

Previous topic - Next topic

remus2k

Hi

I playing a little with DebugPrivilege

Now use i from windows.inc

SE_DEBUG_NAME equ ("SeDebugPrivilege")

A2084: constant value too large
A2114: INVOKE argument type mismatch : argument : 2

I look by msdn and he say:
A constant was specified that was too big for the context in which it was used.


By msdn is Declare

SE_DEBUG_NAME TEXT("SeDebugPrivilege")

This Works Only if you  add the CTEXT Macro in the WIndows.inc
SE_DEBUG_NAME equ CTEXT ("SeDebugPrivilege")

Or add this in your code after the CTEXT Macro

Then if the Windows.inc buggy with all this privileges?


dedndave

how are you trying to use it ?

EDIT - it looks to me as though it should be a TEXTEQU - i dunno
the reference i find is for delphi - and it's translated from Chinese by google  :lol

http://translate.google.com/translate?js=n&prev=_t&hl=en&ie=UTF-8&layout=2&eotf=1&sl=auto&tl=en&u=http%3A%2F%2Fwww.swissdelphicenter.ch%2Ftorry%2Fshowcode.php%3Fid%3D1177&act=url






remus2k

invoke LookupPrivilegeValue,0,SE_DEBUG_NAME,ADDR tpNew.Privileges[0].Luid

A other way is

.data
_SE_DEBUG_NAME db "SeDebugPrivilege",0
.code
invoke LookupPrivilegeValue,0,addr _SE_DEBUG_NAME,ADDR tpNew.Privileges[0].Luid

Gunner

Quote from: remus2k on January 03, 2011, 12:02:40 AM
A other way is

.data
_SE_DEBUG_NAME db "SeDebugPrivilege",0
.code
invoke LookupPrivilegeValue,0,addr _SE_DEBUG_NAME,ADDR tpNew.Privileges[0].Luid


This way is correct, lpName  is a pointer to a null terminated string
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

dedndave

yah - it needs to be a pointer to a null-terminated string
i don't think the EQU is gonna get it

jj2007

What's wrong with invoke LookupPrivilegeValue, 0, chr$("SeDebugPrivilege"), ADDR tpNew.Privileges[0].Luid ??

remus2k

It if not Wrong at this code

What's wrong with invoke LookupPrivilegeValue, 0, chr$("SeDebugPrivilege"), ADDR tpNew.Privileges[0].Luid


I mean only that this not works from the windows.inc
SE_DEBUG_NAME equ ("SeDebugPrivilege")


I look in the sdk under NT Defined Privileges and you can see it use a TEXT Macro :U

#define SE_DEBUG_NAME TEXT("SeDebugPrivilege")


dedndave

SE_DEBUG_NAME TEXTEQU <"SeDebugPrivilege">


invoke LookupPrivilegeValue, 0, chr$(SE_DEBUG_NAME), ADDR tpNew.Privileges[0].Luid

:P

the same string could be used for a number of other EQUates, so DB might be best