Valhalla Legends Forums Archive | Visual Basic Programming | SeDebugPrivilege Help

AuthorMessageTime
Tristan
Hey, I'm coding a program that requires me to set SeDebugPrivilege on itself.  It works fine on my system and not on others.  Some people receive the access denied error when they attempt to open the protected process.  I've been googling for a while and I've found a few different solutions, however none of them have worked.

I've tried having them make sure they're in the administrators group, they are.
I've tried adding them to the Debug Programs local permissions group, which they did successfully.

I've tried more things that I can't remember, none have worked. So does anybody know what may be the problem here?

The people getting the problem are mostly on Windows XP.  But I did see one having it on Vista.
March 7, 2009, 7:50 AM
dRAgoN
vb6?
March 11, 2009, 2:13 PM
BreW
[quote author=l)ragon link=topic=17842.msg181779#msg181779 date=1236780781]
vb6?
[/quote]

You're in the visual basic forum. I would assume so, yes.
March 12, 2009, 12:55 AM
Yegg
[quote author=brew link=topic=17842.msg181782#msg181782 date=1236819322]
[quote author=l)ragon link=topic=17842.msg181779#msg181779 date=1236780781]
vb6?
[/quote]

You're in the visual basic forum. I would assume so, yes.
[/quote]

Ya, but there is also .NET. With this particular topic there may be a big difference between the two.
March 12, 2009, 5:23 AM
MyStiCaL
then i believe it'd go to the board above this one in .net section
March 12, 2009, 9:18 PM
Barabajagal
Only if this board was labeled legacy Visual Basic. As it is, VB.NET will technically fit into either section by definition.

BTW, not to hijack this thread, but what has everyone been hearing about VB 10? I might hang my .NET hate on a shelf to try it out, just to see if they've improved it any.
March 12, 2009, 9:46 PM
Yegg
[quote author=Mystical link=topic=17842.msg181787#msg181787 date=1236892700]
then i believe it'd go to the board above this one in .net section
[/quote]

Then I'd take into consideration the fact that this is a first time poster (hint: he has one post) and thus has a higher chance of placing something in the wrong category.
March 13, 2009, 2:07 AM
MyStiCaL
its still vb6, but this was cool, we just blew up a post that had nothing to do with the original question.
March 13, 2009, 10:59 PM
Quarantine
[quote author=Andy link=topic=17842.msg181788#msg181788 date=1236894419]
BTW, not to hijack this thread, but what has everyone been hearing about VB 10? I might hang my .NET hate on a shelf to try it out, just to see if they've improved it any.
[/quote]

http://blogs.msdn.com/vbteam/archive/2008/11/02/vb-2010-unveiled-at-pdc-2008-lisa-feigenbaum.aspx

Has some VB2010 features from PDC, more might have been unveiled since then.

However, you really should just make the leap to C#. VB .NET will probably always be a second class citizen in .NET .
March 14, 2009, 4:04 AM
Myndfyr
[quote author=Warrior link=topic=17842.msg181793#msg181793 date=1237003455]
However, you really should just make the leap to C#. VB .NET will probably always be a second class citizen in .NET .
[/quote]
That's certainly not the way Microsoft is treating it.
March 14, 2009, 4:06 AM
Barabajagal
And in any case, you can usually convert between any of the three major .NET languages with #Develop.
March 14, 2009, 4:24 AM
Quarantine
[quote author=MyndFyre[vL] link=topic=17842.msg181794#msg181794 date=1237003574]
[quote author=Warrior link=topic=17842.msg181793#msg181793 date=1237003455]
However, you really should just make the leap to C#. VB .NET will probably always be a second class citizen in .NET .
[/quote]
That's certainly not the way Microsoft is treating it.
[/quote]

Why do you think this? There is a quite obvious artificial crippling of the feature sets in VB.NET.

Just look at the features they're just now getting. It's quite pathetic.
Look no further than the C# 4.0 changes versus the VB.NET changes, the difference is quite clear.

Edit:

To further prove my point

[quote]
Visual Basic 2005 introduced features meant to fill in the gaps between itself and other "more powerful" .NET languages, adding:

    * .NET 2.0 languages features such as:
          o generics [3]
          o Partial classes, a method of defining some parts of a class in one file and then adding more definitions later; particularly useful for integrating user code with auto-generated code
          o Nullable Types
    * XML comments that can be processed by tools like NDoc to produce "automatic" documentation
    * Operator overloading [4]
    * Support for unsigned integer data types commonly used in other languages
[/quote]

Source

My point is, Visual Basic, and more recently, Visual Basic .NET, should be avoided like the plague.

Seriously, use C#, it's not that scary.
March 14, 2009, 1:43 PM
Quarantine
[quote author=Andy link=topic=17842.msg181795#msg181795 date=1237004679]
And in any case, you can usually convert between any of the three major .NET languages with #Develop.
[/quote]

That's true, but the point of syntax sugar is for it to be used while writing code.
March 14, 2009, 1:43 PM
Myndfyr
[quote author=Warrior link=topic=17842.msg181796#msg181796 date=1237038180]
To further prove my point

[quote]
Visual Basic 2005 introduced features meant to fill in the gaps between itself and other "more powerful" .NET languages, adding:

    * .NET 2.0 languages features such as:
          o generics [3]
          o Partial classes, a method of defining some parts of a class in one file and then adding more definitions later; particularly useful for integrating user code with auto-generated code
          o Nullable Types
    * XML comments that can be processed by tools like NDoc to produce "automatic" documentation
    * Operator overloading [4]
    * Support for unsigned integer data types commonly used in other languages
[/quote]

Source

My point is, Visual Basic, and more recently, Visual Basic .NET, should be avoided like the plague.

Seriously, use C#, it's not that scary.
[/quote]
Have you ever used Visual Basic .NET? 

Visual Studio 2005 is what deployed .NET 2.0.  Generic types were part of VC# and VB both in Studio 2005, and were not there prior.  Partial classes were introduced in Studio 2005 for both languages.  Nullable types are really an exposure of System.Nullable<T>, introduced in the BCL of .NET 2.0.  VB didn't support the other three items out of the box in 1.x (although people were writing tools to extract XML comments from VB code), but hey, C# doesn't support an intrinsic XML type, so it must suck.  C# doesn't support the My namespace, or the with statement

Visual Basic doesn't have crippling feature sets.  In fact at the PDC talks Anders talked a lot about how when one language gets a feature the other typically wants to add it in right away.  They access the same BCL and they're both considered first-class citizens of the .NET world, at least where Microsoft is involved.
March 14, 2009, 11:40 PM
Quarantine
[quote author=MyndFyre[vL] link=topic=17842.msg181803#msg181803 date=1237074015]
Have you ever used Visual Basic .NET? 
[/quote]

Yes.

[quote author=MyndFyre[vL] link=topic=17842.msg181803#msg181803 date=1237074015]
Visual Studio 2005 is what deployed .NET 2.0.  Generic types were part of VC# and VB both in Studio 2005, and were not there prior.  Partial classes were introduced in Studio 2005 for both languages.  Nullable types are really an exposure of System.Nullable<T>, introduced in the BCL of .NET 2.0.
[/quote]

Of course, however, prior to this, there was a quite noticeable gap in functionality between VB.NET and C#.

Note a lack of overloaded operators, unsafe code, unsigned types, using statements, hell VB until 2005 didn't even have inheritance or interfaces!

You call that a first class citizen? Give me a break.

[quote author=MyndFyre[vL] link=topic=17842.msg181803#msg181803 date=1237074015]
  VB didn't support the other three items out of the box in 1.x (although people were writing tools to extract XML comments from VB code), but hey, C# doesn't support an intrinsic XML type, so it must suck.  C# doesn't support the My namespace, or the with statement
[/quote]

Those are rather weak things to complain about, it's pretty obvious that VB.NET has historically always been a step behind C#.

[quote author=MyndFyre[vL] link=topic=17842.msg181803#msg181803 date=1237074015]
Visual Basic doesn't have crippling feature sets.  In fact at the PDC talks Anders talked a lot about how when one language gets a feature the other typically wants to add it in right away. 
[/quote]

The language which typically gets the feature first is C#, which is the entire basis behind my argument. C# is at the forefront of .NET development, it's very seldom C# gets features VB has had for a while (The recent exception being named and optional params)

[quote author=MyndFyre[vL] link=topic=17842.msg181803#msg181803 date=1237074015]
They access the same BCL and they're both considered first-class citizens of the .NET world, at least where Microsoft is involved.
[/quote]

History seems to disagree.
March 15, 2009, 3:27 AM
Myndfyr
[quote author=Warrior link=topic=17842.msg181806#msg181806 date=1237087634]
Note a lack of overloaded operators, unsafe code, unsigned types, using statements, hell VB until 2005 didn't even have inheritance or interfaces!
[/quote]
Again, you're wrong: Visual Basic was a fully object-oriented .NET citizen as of 2002 when C# debuted.  As far as overloaded operators, unsafe code, and unsigned types, the bottom line is that these are edge cases.  I can count on my hands the number of times I've ever used unsafe code for personal projects and never used it in a professional project.  Overloaded operator creation is also pretty infrequent (how often do you need to reimplement a numeric type?).  And unsigned types are the same thing too - they're not used in the BCL, they're not part of SQL, and even if you could say they're useful for B.net, the bottom line is that lots of people have gotten by without them with VB6.  So... who cares?

[quote author=Warrior link=topic=17842.msg181806#msg181806 date=1237087634][quote author=MyndFyre[vL] link=topic=17842.msg181803#msg181803 date=1237074015]
  VB didn't support the other three items out of the box in 1.x (although people were writing tools to extract XML comments from VB code), but hey, C# doesn't support an intrinsic XML type, so it must suck.  C# doesn't support the My namespace, or the with statement
[/quote]

Those are rather weak things to complain about, it's pretty obvious that VB.NET has historically always been a step behind C#.[/quote]
Ever use the My namespace?  Pretty fucking awesome.  Access to ports, audio, user, network stack, application log....  The intrinsic XML type is pretty awesome too.  Did you look at the link I provided? 

[quote author=Warrior link=topic=17842.msg181806#msg181806 date=1237087634]
The language which typically gets the feature first is C#, which is the entire basis behind my argument. C# is at the forefront of .NET development, it's very seldom C# gets features VB has had for a while (The recent exception being named and optional params)
[/quote]
Oh yeah, VB has had optional parameters since... forever.  So has C++, incidentally.  The descendant C#, though, didn't.  Hmmm....

[quote author=Warrior link=topic=17842.msg181806#msg181806 date=1237087634]
History seems to disagree.
[/quote]
I might suggest actually doing some research:
[quote author=Jay Roxe, VB Product Manager] Portions of the CLR are written in C# and portions are written in VB – both languages are first-class citizens on the CLR

I don’t believe that differences in the languages make one a second-class citizen. The teams have chosen to invest in different features, but this provides advantages to developers because it gives them a better opportunity to select the tool that’s right for the job.[/quote]
March 15, 2009, 4:10 AM
Quarantine
[quote author=MyndFyre[vL] link=topic=17842.msg181808#msg181808 date=1237090218]
Again, you're wrong: Visual Basic was a fully object-oriented .NET citizen as of 2002 when C# debuted.
[/quote]

Interesting, I remember reading an article which suggested the contrary. Oh well, good that it's not as bad as I thought.

[quote author=MyndFyre[vL] link=topic=17842.msg181808#msg181808 date=1237090218]
  As far as overloaded operators, unsafe code, and unsigned types, the bottom line is that these are edge cases.  I can count on my hands the number of times I've ever used unsafe code for personal projects and never used it in a professional project.  Overloaded operator creation is also pretty infrequent (how often do you need to reimplement a numeric type?).  And unsigned types are the same thing too - they're not used in the BCL, they're not part of SQL, and even if you could say they're useful for B.net, the bottom line is that lots of people have gotten by without them with VB6.  So... who cares?
[/quote]

There's also partial interfaces, yield, static classes, and auto properties, but the overall point is that it does get features later, regardless of how important you think they are.


[quote author=MyndFyre[vL] link=topic=17842.msg181808#msg181808 date=1237090218]
Ever use the My namespace?  Pretty fucking awesome.  Access to ports, audio, user, network stack, application log....  The intrinsic XML type is pretty awesome too.  Did you look at the link I provided? 
[/quote]

No, they sound neat, but they can most certainly be dismissed in the same manner you dismissed the differences I cited.

[quote author=MyndFyre[vL] link=topic=17842.msg181808#msg181808 date=1237090218]
Oh yeah, VB has had optional parameters since... forever.  So has C++, incidentally.  The descendant C#, though, didn't.  Hmmm....
[/quote]

And how useful are they? C# has function overloading, so the only advantage for them is probably COM Interop.


[quote author=MyndFyre[vL] link=topic=17842.msg181808#msg181808 date=1237090218]
[quote author=Jay Roxe, VB Product Manager] Portions of the CLR are written in C# and portions are written in VB – both languages are first-class citizens on the CLR

I don’t believe that differences in the languages make one a second-class citizen. The teams have chosen to invest in different features, but this provides advantages to developers because it gives them a better opportunity to select the tool that’s right for the job.[/quote]
[/quote]

What do you expect him to say? One language has precedence over the other? Obvious they want to cater to a large audience.

March 15, 2009, 5:18 AM
BreW
I don't understand why Warrior fails to see that they - as two separate languages - have different goals and audiences. Even the Express websites highlight this fundamental difference in the product descriptions.
Visual Basic '08: "Productivity that is ideal for first time or casual Windows programming."
C# '08: "A great combination of power and productivity for the Windows developer."
It should be obvious that by being developed by two different camps, each will inject their own philosophy, with different ideas of how their language should be, what features work for them, what would benefit the target audience the most, etc. Not necessarily the most powerful to develop with.
Of course it's obvious microsoft may tend to lean on the C# side (you seriously can't forget the aura Visual Basic left behind, plus C# has a load of java nuts and people who were disappointed with C++ .NET) so I agree with Warrior. Not to the extent he does, though.
C'mon, no politics threads on x86, so you bring your ranting and raving over here? Try making a productive post once in a while. I don't really see anything going on here except your e-peenor extending.
March 15, 2009, 1:23 PM
Quarantine
[quote author=brew link=topic=17842.msg181811#msg181811 date=1237123401]
I don't understand why Warrior fails to see that they - as two separate languages - have different goals and audiences. Even the Express websites highlight this fundamental difference in the product descriptions.
Visual Basic '08: "Productivity that is ideal for first time or casual Windows programming."
C# '08: "A great combination of power and productivity for the Windows developer."
It should be obvious that by being developed by two different camps, each will inject their own philosophy, with different ideas of how their language should be, what features work for them, what would benefit the target audience the most, etc. Not necessarily the most powerful to develop with.
Of course it's obvious microsoft may tend to lean on the C# side (you seriously can't forget the aura Visual Basic left behind, plus C# has a load of java nuts and people who were disappointed with C++ .NET) so I agree with Warrior. Not to the extent he does, though.
C'mon, no politics threads on x86, so you bring your ranting and raving over here? Try making a productive post once in a while. I don't really see anything going on here except your e-peenor extending.
[/quote]

tl;dr I reach the same conclusion Warrior reached, only I inject large amounts of stupid inbetween.

edit: ew you browse x86, yuck, ban it.
March 15, 2009, 1:30 PM
BreW
I figured I'd get a stupid response.
Oh well, I think you're just butthurt about being trolled. How does it feel to be trolled, troll?
March 15, 2009, 2:02 PM
Yegg
Regardless what anyone thinks, we need threads with content like this. When two intelligent people such as MyndFyre and Warrior debate on a topic where they both know a great deal of info on, others can learn from it -- which is largely what this forum has been used for.
March 15, 2009, 2:37 PM
Quarantine
Well, my original point (Due to what I was led to believe by another article) might have been a little over the top, so Myndy is correct in that there's much less of a rift than I thought.

As for brew, I really do not pay him any mind, he strikes me as pedantic, though I'm not even sure that applies because it requires him to actually be intelligent. Ah well.
March 15, 2009, 3:22 PM
BreW
Oh come on, get real Yegg. The activity should lie within the new members. Unfortunately, the only new members on this board are:
70%: People who want help with D2GS packet compression, so they can make d2 botz to farm items.
20%: People who want help with making a winbot, and/or battle.net loader robot.
10%: People who see vL as this amazing and active clan, and figure they'd sign up for the hell of it and never post.
March 15, 2009, 3:27 PM
Yegg
[quote author=brew link=topic=17842.msg181816#msg181816 date=1237130820]
Oh come on, get real Yegg. The activity should lie within the new members. Unfortunately, the only new members on this board are:
70%: People who want help with D2GS packet compression, so they can make d2 botz to farm items.
20%: People who want help with making a winbot, and/or battle.net loader robot.
10%: People who see vL as this amazing and active clan, and figure they'd sign up for the hell of it and never post.
[/quote]

So why even bring this up? It seems like all the newest members just learned partial English three weeks ago anyway. The existing (and mainly longterm members) are the ones continuing to keep some kind of useful content on the website. They do this by threads like this, and by answering an occasional question by a newcomer (which are extremely rare now) or existing member.
March 16, 2009, 12:38 AM
BreW
Then it's settled. We argue with eachother.
March 16, 2009, 2:31 AM
Myndfyr
[quote author=brew link=topic=17842.msg181818#msg181818 date=1237170712]
Then it's settled. We argue with eachother.
[/quote]

No we don't.
March 16, 2009, 3:03 AM
Barabajagal
Brew, shut up.
Warrior, stop arguing against the existence of a language you don't like. Why do you pretend to care? You know you don't.
Mynd, you're a moderator, aren't you? Why are you allowing this kind of off-topic crap in the thread of someone asking for knowledge that this site is used for?

This is ridiculous.
March 16, 2009, 3:10 AM
BreW
Shut up andy, flow with it or be a sore thumb. But seriously. I don't see anything wrong with off topic crap when it's the only crap we have to work with.
March 16, 2009, 4:04 AM
Yegg
[quote author=brew link=topic=17842.msg181821#msg181821 date=1237176245]
Shut up andy, flow with it or be a sore thumb. But seriously. I don't see anything wrong with off topic crap when it's the only crap we have to work with.
[/quote]

Agreed. Off-topic content is good for now, considering without it the current forum activity would decrease significantly.
March 16, 2009, 5:22 AM
Myndfyr
[quote author=Andy link=topic=17842.msg181820#msg181820 date=1237173053]
Mynd, you're a moderator, aren't you? Why are you allowing this kind of off-topic crap in the thread of someone asking for knowledge that this site is used for?
[/quote]
Not a moderator of this forum, no.  But a lot of this discussion, while off-topic for the particular thread, isn't necessarily off-topic for the forum.  So, meh.
March 16, 2009, 5:23 AM
MysT_DooM
[quote author=Tristan link=topic=17842.msg181738#msg181738 date=1236412208]
Hey, I'm coding a program that requires me to set SeDebugPrivilege on itself.  It works fine on my system and not on others.  Some people receive the access denied error when they attempt to open the protected process.  I've been googling for a while and I've found a few different solutions, however none of them have worked.

I've tried having them make sure they're in the administrators group, they are.
I've tried adding them to the Debug Programs local permissions group, which they did successfully.

I've tried more things that I can't remember, none have worked. So does anybody know what may be the problem here?

The people getting the problem are mostly on Windows XP.  But I did see one having it on Vista.
[/quote]

Well i've read a bit, and am thinking you might have to change the access tokens of the process. So did you try to adjust the tokens privileges?  What did you try to do?
I read some more now, did you try looking into CreateProcessAsUser(), I believe that will get you to launch a process with a specified token, but I believe you'd have to change the security descriptor of that access token to allow that. This is alot of token business, anyways the following links might be more insightful, but i'll probably mess around with this later:


Access Rights for Access-Token Objects
AdjustTokenPrivileges Function
GetSecurityInfo Function
KillProcess - Terminate any application, shows token changing examples
March 16, 2009, 7:01 PM

Search