I don't think you read what I wrote.
And I don't think you've tried terminating a multithreaded app that way.
And while it's a nice trick for specific stuff, never ever use it in production code.
Posted on 2003-04-22 16:27:50 by f0dder
i will use whatever i want, i was testing it on *all* 32 bit Win versions, so dont tell me it doesnt work
Posted on 2003-04-22 16:35:49 by bart
yeah, bitch. don't mess with bart
Posted on 2003-04-22 16:50:04 by comrade
too bad if microsoft changes the rules some day (and yes, they CAN do this as you're relying on undocumented behavior). Again, it's fine for fun-stuff and stuff like 4k intros - but do it in release apps and you're a moron.

Also, do yourself the favour and re-read my posts. Realize that you should test the following to understand what I mean. Create a program that spawns a thread. Make the thread do a MessageBox or whatever. Let main thread do a "ret". Realize that application doesn't terminate until messagebox is closed. Realize that this is because a process will not terminate until all threads are done.

This will not matter for such a simple app, but if you have threads working for events etc, you should be doing ExitProcess. But I guess you don't work with real apps, based on your attitude.
Posted on 2003-04-22 16:50:37 by f0dder
fudder, you made me cry :) double lol, you should receive reward in the category "ego ass of the year", well say whatever you want, but for me, you are another "hello world" programmer, long live in your WinApi world :)

comrade thanks for support, my red bro :)
Posted on 2003-04-22 17:13:04 by bart
heh, who's the one with the 1337h4xx0r attitude?
I'm acknowleging that "-at-program-startup" has its uses... but it's not a good generic approach.

Oh, and sorry for being a bit harsh, that was uncalled for I guess. I just don't like when people are promoting undocumented things on a board where other people take this for granted without doing any thinking of their own.
Posted on 2003-04-22 17:19:09 by f0dder
f0dder no prob, sorry for being so leet-ass, you have right about those threads :)
Posted on 2003-04-22 17:25:18 by bart
fine :). "shake hands and make friends". Hi, I am f0dder, and I can be grumpy. Especially if I'm tired. G'nite ;)
Posted on 2003-04-22 17:27:39 by f0dder
Mmmph, why has this old thread been regurgitated?


f0dder, i was expecting a bit more of a flame war, you let me down :grin:

bart,
welcome to the board, be careful whose ego you criticise :) The little trick you were showing us is real, but its relevancy (its uses) is minimal. Instead of trying to fit functionality into a tiny little space, it would be better to insert a call to your own dll code which is then injected into the process.
Posted on 2003-04-22 21:59:56 by sluggy
someone asked for 16bit? :D



DSEG SEGMENT
;
dseg ends
sseg segment stack
dw 100h dup(?)
sseg ends
cseg segment word public 'code'
assume cs:cseg,ds:dseg,ss:sseg
start proc far
push ds
mov ax,0
PUSH AX
MOV AX,DSEG
mov ds,ax
;
;<main program>
;
;
;
;
ret ;<end of program>
start endp
cseg ends ;<end of segment>
end start
Posted on 2003-04-23 04:06:59 by wizzra
f0dder Bart,

You are talking at different purposes, both views have their place but they are not the same place.

Non standard stuff risks failing on one version of Windows or another and often the so called standard stuff can fail as well because Microsoft DO change their mind here and there.

With special purpose code that is tuned for one version, if it works, it works but may not be portable across version, particularly future versions so what you are arguing is caution versus dedicated apps.

No one is twisting arms in either direction so its not worth geting wound up about it.

Regards,

hutch@movsd.com
Posted on 2003-04-23 07:24:13 by hutch--