The Official Status Thread
-
@Tsaukpaetra said in The Official Status Thread:
So in other words do:
int toss = CloseHandle(hProc);
?
BOOL toss = CloseHandle(hProc);
from windef.h:
typedef int BOOL;
And if you do RTM, there is another caveat:
If the application is running under a debugger, the function will throw an exception if it receives either a handle value that is not valid or a pseudo-handle value. This can happen if you close a handle twice, or if you call CloseHandle on a handle returned by the FindFirstFile function instead of calling the FindClose function.
-
@Tsaukpaetra said in The Official Status Thread:
Dunno, it's been years since I did stuff in plain old C/C++...
Any reason why you don't know if the handle is valid or not? OTOH, it's probably best in C++ to wrap that stuff up in a RAII-style class…
-
@anotherusername said in The Official Status Thread:
CloseHandle(hProc) will always throw the exception when it doesn't like hProc,
No. RTFM!
-
@dcon said in The Official Status Thread:
@Tsaukpaetra said in The Official Status Thread:
So in other words do:
int toss = CloseHandle(hProc);
?
BOOL toss = CloseHandle(hProc);
from windef.h:
typedef int BOOL;
And if you do RTM, there is another caveat:
If the application is running under a debugger, the function will throw an exception if it receives either a handle value that is not valid or a pseudo-handle value. This can happen if you close a handle twice, or if you call CloseHandle on a handle returned by the FindFirstFile function instead of calling the FindClose function.
Yeah, I was reading that page, and decided to skip that for incompetence reasons (I'm not using file handles anyway).
-
@dcon So... the only reason it's throwing an exception at all is because he's debugging it? Otherwise it would just return
(BOOL) 0
?
-
@anotherusername Yup. And the exception it throws is SEH, not C++.
edit: http://stackoverflow.com/questions/1550315/how-to-catch-exception-from-closehandle
-
@anotherusername said in The Official Status Thread:
@dcon So... the only reason it's throwing an exception at all is because he's debugging it?
Maybe. If I just run it straight out nothing unusual happens (that I can see).
Really, it should be a "Hey dufus you did something wrong!" console message, not a "We're going to Break here because you're retarded" error.
-
Status: Umm... what?
That's not the app I'm writing...
-
-
@Tsaukpaetra yeah, that's really dumb. How are you supposed to properly debug your code to handle it returning false if it just blows up when you try to test that inside a debugger?
And why doesn't
try ... catch
provide some method of catching that sort of exception by default? You shouldn't need to enable some arcane compiler setting to make it catch an exception that happens outside your code.
-
@anotherusername said in The Official Status Thread:
@Tsaukpaetra yeah, that's really dumb. How are you supposed to properly debug your code to handle it returning false if it just blows up when you try to test that inside a debugger?
I mean, ideally you shouldn't be trying to close invalid handles, but it's a thing that can happen if, say, the user closes the sub-launched app by hand (If I'm reading my notes right). In that case, the handle is already closed and nothing to do here. But, if I don't close the handle, mysterious things happen or something.
-
@Tsaukpaetra I guess you could wrap it in a class that contains an
IsOpen
boolean value and putsCloseHandle
inside a wrapper that'll only call it once and flip that boolean off...(The more I think about that, the less I like it.)
-
@anotherusername said in The Official Status Thread:
@Tsaukpaetra I guess you could wrap it in a class that contains a
HasBeenClosedAlready
boolean value and putsCloseHandle
inside a wrapper that'll only call it once...Lol maybe. This code is already messy enough as it is. Supposedly, the handle is closed anyways when I'm telling the process to close (which is what's making it invalid? I dunno, not important on a machine that has an expected lifecycle runtime of less than three days uptime. I doubt I'll run out of handles even if they do leak...
-
@Tsaukpaetra said in The Official Status Thread:
@anotherusername said in The Official Status Thread:
@Tsaukpaetra yeah, that's really dumb. How are you supposed to properly debug your code to handle it returning false if it just blows up when you try to test that inside a debugger?
I mean, ideally you shouldn't be trying to close invalid handles, but it's a thing that can happen if, say, the user closes the sub-launched app by hand (If I'm reading my notes right). In that case, the handle is already closed and nothing to do here. But, if I don't close the handle, mysterious things happen or something.
Raymond talks about handles today. If you passed a handle to a subprocess, you still need to close it on both sides.
-
@anotherusername said in The Official Status Thread:
And why doesn't try ... catch provide some method of catching that sort of exception by default? Y
Because try/catch is C++ and SEH isn't.
-
@dcon said in The Official Status Thread:
@Tsaukpaetra said in The Official Status Thread:
@anotherusername said in The Official Status Thread:
@Tsaukpaetra yeah, that's really dumb. How are you supposed to properly debug your code to handle it returning false if it just blows up when you try to test that inside a debugger?
I mean, ideally you shouldn't be trying to close invalid handles, but it's a thing that can happen if, say, the user closes the sub-launched app by hand (If I'm reading my notes right). In that case, the handle is already closed and nothing to do here. But, if I don't close the handle, mysterious things happen or something.
Raymond talks about handles today. If you passed a handle to a subprocess, you still need to close it on both sides.
How... fortuitous? That's kinda creepy.
Luckily I'm not really using the handles for anything other than closing the subprocess if it still exists.
-
@Tsaukpaetra said in The Official Status Thread:
How... fortuitous? That's kinda creepy.
THE TWILIGHT ZONE THEME – 00:57
— mattsproductions12
-
Status: Still not used to not being a White 'A' on Green background... Catches me off guard every time..
-
@Tsaukpaetra said in The Official Status Thread:
But, if I don't close the handle, mysterious things happen or something.
Somehow I can instruct my program to try killing a subprocess that I already killed, and this is what happens:
Yeah, that's a bug alright...
-
Status: I guess there is no such thing as a quality VGA cable anymore. I have an 8-port KVM switch with VGA and it had no problem doing 1920x1080, but with my new desk arrangement at my new place the cord I had for it was too short. I have now gone through two 1080p-rated VGA cables I bought online (one very cheap, one moderately expensive) and neither of them will do better than 1024x768.
It's dumb that modern "high-quality" VGA cables are worse than whatever junk cord I have left over from 15 years ago...
-
Status: Huh. Seems certain chats can never retrieve the profile image of certain peoples...
-
@Tsaukpaetra
Probably because their avatar has changed 3 times since you opened the chat window to go looking.
-
@izzion said in The Official Status Thread:
@Tsaukpaetra
Probably because their avatar has changed 3 times since you opened the chat window to go looking.Validating...
I'm going to go with only two of those have had avatar changes within the last three months.
-
@Tsaukpaetra said in The Official Status Thread:
that's a bug
Ok, here's Alpha 0.2 of my little game server launcher thingy (not to be used
in a production environment).It can technically load up an .ini file, but that's not important.
The important thing is that it's a self-contained micro web server that can launch processes, all without using any extra DLLs or other dependencies not inherent in a base Windows PE environment (well, tested in PE 3.1, but should work on anything since WinNT based)
By default it just launches Notepad.exe (which is presumably in the %path%). It's intended to launch Unreal Engine servers though.
-
@mott555 Try Monoprice. They're a manufacturer and they have some rather fucking serious VGA cables.
Hell, they have 1.5 inch thick HDMI cables.
-
@Tsaukpaetra said in The Official Status Thread:
Status: Huh. Seems certain chats can never retrieve the profile image of certain peoples...
On this night, you will be visited by three ghosts.
The ghost of Blakeyrat past.
The ghost of Blakeyrat present.
And the ghost of Blakeyrat future.
-
I call bullshit on that, Jimmy.
-
Boss wanted me to do something at home because he didn't do the red tape necessary for itsec to allow me to install the necessary tools in my work machine.
Now I need to keep nagging him to put this time as worked hours in the system the entire month, because he keeps forgetting.
-
-
Status: Somehow ended up with two copies of Outlook running
And yet, nothing bad happened
-
@RaceProUK
I mean, it's a fully supported configuration. And I know several people who would intentionally do that, so they could have their e-mail open on one monitor and their calendar open on another without having to switch back and forth.
-
Status: 2 weeks and 2 days ago, I procured a new laptop because it's high time I got something with an SSD which can start thunderbird in under 15 minutes.
2 weeks ago, this got approved and turned into a PO.
And nothing happened since. I'm getting impatient.
-
@izzion said in The Official Status Thread:
I mean, it's a fully supported configuration.
I know. I just expected because Outlook
-
@PleegWat said in The Official Status Thread:
Status: 2 weeks and 2 days ago, I procured a new laptop because it's high time I got something with an SSD which can start thunderbird in under 15 minutes.
2 weeks ago, this got approved and turned into a PO.
And nothing happened since. I'm getting impatient.
cancel th PO, use the money to buy your own and then expense it to the company using the PO number that was aproved?
-
@accalia The actual process is you need to get approval first via a separate system, then when you have approval you order the specific device in the procurement system. The procurement system contains many different types of hardware serving different layers of the company - ordering anything different than the specific device for your LOB (choice of 2 brands and a variety of keyboard layouts) will get rejected in the procurement system. Even if it's cheaper.
-
last night's status Surprised at how long it takes to get thru to 911 on a cell phone.
I was just walking into my driveway with my dog when I heard:
- tires skidding
- CrUnCh
- SCREEEEAAAMMMMMM
A bicyclist was hit by a car as they waited to make a left turn at an intersection (both streets are 25mph). This was about 3 houses down from me. After what seemed like forever, the 911 call finally connected (others had gotten thru before me). Police arrived about 2 minutes later and Fire arrived soon after that (there's a station fairly close to me). It was night (barely) with wet streets (not currently raining). The cyclist had a light on the front, no idea about rear. Hope they're doing okay...
-
status Reading Schlock Mercenary while the compile finishes.
Hmm... wheres that thread about English bashing... (US/UK/whatever):
-
Status: Apparently this is a band. This album has a funny name.
WANIMA-リベンジ(OFFICIAL VIDEO) – 03:13
— pizzaofdeathofficial
-
@dcon Much more likely it was surge volume related. You said other people got through before you did, the local center probably only had one or two operators with their butt in the seat and not already a call. You had to wait for one to sit down and hit the answer button (or for a reroute to another center)
-
@Weng said in The Official Status Thread:
@dcon Much more likely it was surge volume related. You said other people got through before you did, the local center probably only had one or two operators with their butt in the seat and not already a call. You had to wait for one to sit down and hit the answer button (or for a reroute to another center)
Possibly. I was just surprised I didn't get a 'please wait' or something quickly. It just continued ringing on-and-on-and-on until picked up (at least 30 seconds). I was figuring the weird way 911 works with cell phones.
-
@dcon said in The Official Status Thread:
@Weng said in The Official Status Thread:
@dcon Much more likely it was surge volume related. You said other people got through before you did, the local center probably only had one or two operators with their butt in the seat and not already a call. You had to wait for one to sit down and hit the answer button (or for a reroute to another center)
Possibly. I was just surprised I didn't get a 'please wait' or something quickly. It just continued ringing on-and-on-and-on until picked up (at least 30 seconds). I was figuring the weird way 911 works with cell phones.
Yeah that's kinda weird. Last time I called 911 I got an IVR...
-
@Magus Because that probably didn't interest anyone enough to check, the album is called "Are You Coming?"
-
Status: SNOW!!!!
-
@Magus said in The Official Status Thread:
@Magus Because that probably didn't interest anyone enough to check, the album is called "Are You Coming?"
Not yet! Keep going!
-
@Tsaukpaetra said in The Official Status Thread:
Status: Huh. Seems certain chats can never retrieve the profile image of certain peoples...
Yeah, the chats occasionally get confused.
-
Goddamn it, John Glenn.
=(
-
-
Status: Um... no?
Ask me that on my fscking phone, retards!
-
Status: Applying updates to my compiler toolchain. C++ compilers take forever to build from source…
-
The electric company has picked one day during this period to turn off the heating between 8.00 and 18.00. Guess which day they chose: