flat assembler
Message board for the users of flat assembler.
Index
> Projects and Ideas > Sparky8 - The system response improver Goto page Previous 1, 2, 3 Next |
Author |
|
LocoDelAssembly 14 Mar 2007, 00:22
Yes, I know f0dder and if it must be done no problem but here we have that the current documentation breaks the previous one but there was programs coded in the time were the old docs were written and those old docs told to the programmers that LastError is always set by CreateMutex.
I edited my post with nice colours to see the LastError sets more clear |
|||
14 Mar 2007, 00:22 |
|
f0dder 14 Mar 2007, 00:32
Well, weren't the old docs ported from the win16 docs? Things have been added since that, etc.
Oh well. Safe coder <3 |
|||
14 Mar 2007, 00:32 |
|
vid 14 Mar 2007, 00:32
Quote: but here we have that the current documentation breaks the previous one [...] and those old docs told to the programmers that LastError is always set by CreateMutex. no they didn't: Quote: Return Values Problem is that you state that "otherwise" applies to first "if", not to second "if". If "otherwise" applies to first if you are right, if to second you are not. Gramatically, this is usage of ambigous context, so we can say MSDN doesn specify it clearly. Anyway, it is common to use last suitable item as context, and in such case you are wrong. |
|||
14 Mar 2007, 00:32 |
|
vid 14 Mar 2007, 00:33
Quote: It would make sense that all APIs with a returncode does clear lasterror on success, but knowing Microsoft... well |
|||
14 Mar 2007, 00:33 |
|
LocoDelAssembly 14 Mar 2007, 01:02
No vid, I apply it to second "if" but even with that for me it still means that it's always set because the second "if" requieres a "If the function succeeds, ..." to be true.
My english skills are lower than the average of the members of this forum so forgive me if I make a lot of noise with wrong deduction from my part. Note that if the second "if" doesn't requieres the first one to be true then the docs leaves undefined which return value you have under an ERROR_ALREADY_EXISTS (unless I'm doing wrong gramatical interpretation again). |
|||
14 Mar 2007, 01:02 |
|
vid 14 Mar 2007, 10:20
Quote: No vid, I apply it to second "if" but even with that for me it still means that it's always set because the second "if" requieres a "If the function succeeds, ..." to be true. Now I understand why they changed this description Anyway, my interpretation is how they MEANT it, you can find out by reading corrected description in newer MSDN. And still, you shouldn't just ignore another errors, every error you wasn't awaiting should be displayed and program terminated. This is extremely helpful for debugging, and required in serious programming |
|||
14 Mar 2007, 10:20 |
|
LocoDelAssembly 14 Mar 2007, 14:01
Code: include 'win32axp.inc' .code _mutex_name db "Mutex Test", 0 start: invoke CreateMutex,NULL,FALSE,_mutex_name mov esi, eax invoke GetLastError mov edi, eax invoke CreateMutex,NULL,FALSE,_mutex_name mov ebx, eax invoke GetLastError int3 .end start Code: ESI = $10 EDI = 0 EBX = $20 EAX = $B7 The ERROR_ALREADY_EXISTS is a succesful error like ERROR_SUCCESS. The function can fail if you try to create a named mutex which already exists but you don't have privilegies to do that but in that case the function really fails and sets ERROR_ACCESS_DENIED and returns NULL. Also note that the qoute lost the original format but actually the "If the function succeeds, ..." and "If the function fails, ..." belongs to different paragraphs. The first paragraph for me guaranties that LastError will be set always you try to create a NAMED mutex and the second paragraph guaranties at any fail situation that LastError will be set. The real scenario where LastError is undefined by the old docs is when you create an UNNAMED mutex. BTW, did you see http://msdn2.microsoft.com/en-us/library/ms682396.aspx ? There there is a very similar copy of my quote but in the context of CreateEvent. I see that current software tends to use this instead of CreateMutex but dissasembling MSN Messenger I see that they check the return value before calling GetLastError (but MSN Messenger silently dies like in the ERROR_ALREADY_EXISTS case). Well, I think that I must do it like you said but I think that the docs are wrong then. |
|||
14 Mar 2007, 14:01 |
|
vid 14 Mar 2007, 15:11
Quote: Well, I think that I must do it like you said but I think that the docs are wrong then. |
|||
14 Mar 2007, 15:11 |
|
Plue 15 Mar 2007, 12:00
This works a bit on my computer, but most of the lagging here comes when a program accesses the disk, not because it uses all CPU. Is it possible to reduce the maximum allowed disk access time per time slice or something?
|
|||
15 Mar 2007, 12:00 |
|
f0dder 15 Mar 2007, 12:26
Plue wrote: This works a bit on my computer, but most of the lagging here comes when a program accesses the disk, not because it uses all CPU. Is it possible to reduce the maximum allowed disk access time per time slice or something? For that, you need the super duper new and improved WINDOWS VISDUUUUUH! _________________ - carpe noctem |
|||
15 Mar 2007, 12:26 |
|
white_wight 28 Mar 2007, 09:09
http://s0m.narod.ru/
another one system response improver
Last edited by white_wight on 12 Apr 2007, 01:03; edited 1 time in total |
|||||||||||
28 Mar 2007, 09:09 |
|
f0dder 28 Mar 2007, 11:22
white_wight: that site doesn't support direct links - you have to go to s0m.narod.ru before you can download the zip...
And gah, why do people comment their sourcecode in anything but English? >_< |
|||
28 Mar 2007, 11:22 |
|
rugxulo 31 Mar 2007, 04:29
f0dder wrote: white_wight: Because Morse code is too bloated? Seriously, I think only about 20% (or less??) of the world's population speaks English. Besides, English is a bit complex to learn, and takes a long time. It'd be better if people used something sensible (IMO, Esperanto), but popular opinion (for now) disagrees. P.S. It would've been funnier if you'd said that in Danish. (Go ahead and edit your post to add it. Pretty please?) |
|||
31 Mar 2007, 04:29 |
|
f0dder 31 Mar 2007, 06:07
rux: I'm definitely it would be so grreat if everybody commented in English. Espically the Russians, they do some GODDAMN great stuff!
Jeg ville ønske at alle folk var internationale! |
|||
31 Mar 2007, 06:07 |
|
white_wight 12 Apr 2007, 01:10
Quote: rux: I'm definitely it would be so grreat if everybody commented in English. Espically the Russians, they do some GODDAMN great stuff! Maybe because some don't know English that much. (check particularly the exit message box of those Speedballs ) Quote: Jeg ville ønske at alle folk var internationale! Eh? |
|||
12 Apr 2007, 01:10 |
|
f0dder 12 Apr 2007, 12:05
See, that sentence made as much sense to you as russian (and a bunch of other languages) make to most people
"I wish that everybody were international" - and now it makes sense. |
|||
12 Apr 2007, 12:05 |
|
white_wight 12 Apr 2007, 14:05
rugxulo wrote: Seriously, I think only about 20% (or less??) of the world's population speaks English. Besides, English is a bit complex to learn, and takes a long time. It'd be better if people used something sensible (IMO, Esperanto), but popular opinion (for now) disagrees. Well, if you are español, Français, italiano or Englishman, then of course it will take a couple of month for you to master Esperanto. And what about Arab or Japanese or Chinese? I don't think that for those folks it is that easier to learn Esperanto. Moreover, there are more resourses to study English than any other language in the world. At least for now. |
|||
12 Apr 2007, 14:05 |
|
r22 13 Apr 2007, 02:37
I don't see the reason for the sleep and loop approach for sparky.
I'm pretty sure SetWindowsHookEx using WH_SHELL will return the handle of a just activated window which would remove the polling and make it event driven. The Win XP64 kernel is pretty well optimized, but I did find one bad function that I patched to improve the overall speed. I think there's a thread about it, but just cranking the priority is a lot easier and service pack proof than patching system dlls. Vista64 probably has a few Rtl functions that are sub-optimal. Microsoft doesn't really take advantage of the almost global compatibility with SIMD when compiling 64 bit code (IE no current x86 64 processor is without SSE2 extensions). Function that drivers seem to call a lot are the best candidates for patching, when I get Vista64 I'll do a little decompiling and see what turns up. Wonder if its possible to recreate a system dll with customized/optimized functions then make a slip streamed copy of your install cd/dvd with the new dll. Not sure of the kernel integrity checks would bug out or not. |
|||
13 Apr 2007, 02:37 |
|
f0dder 13 Apr 2007, 12:23
r22 wrote:
I don't think this is a good idea... it's too much bother doing this, it will be nuked by windows update, and the system will probably also bitch about it because it detects the DLLs as modified (drivers are even worse, requiring signing and all that). So, in-memory patching is probably the best route to take. Can probably even be made pseudo-generic, if replacement code size <= original code size... but of course doing the patching is a bit tricky. |
|||
13 Apr 2007, 12:23 |
|
Goto page Previous 1, 2, 3 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.