flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Garthower 03 Oct 2006, 07:52
Show, how you fill structs please.
|
|||
![]() |
|
ChrisLeslie 03 Oct 2006, 08:18
Ah! I am not filling any members. Are there any that definitely need filling?
Chris |
|||
![]() |
|
Garthower 03 Oct 2006, 08:24
Yes, it's need to fill them. Otherwise consequences are unpredictable.
|
|||
![]() |
|
ChrisLeslie 03 Oct 2006, 08:48
I notice in other examples that STARTUPINFO member cb is initialised to the size of the struct. How is the size determined using FASM?
Also, I am a bit confused by this because I think that the size should be constant. |
|||
![]() |
|
madmatt 03 Oct 2006, 08:55
if you are using fasm's 'struct' then a label is automatically created: sizeof.STARTUPINFO
also: invoke CloseHandle, pr_info.hThread invoke CloseHandle, pr_info.hProcess should be: invoke CloseHandle, [pr_info.hThread] invoke CloseHandle, [pr_info.hProcess] |
|||
![]() |
|
Garthower 03 Oct 2006, 09:06
Or you are not using fasm's "struct" macro you can do this with labels, for example so:
Code: ..... pr_info: cb dd ? lpReserved dd ? lpDesktop dd ? lpTitle dd ? dwX dd ? dwY dd ? dwXSize dd ? dwYSize dd ? dwXCountChars dd ? dwYCountChars dd ? dwFillAttribute dd ? dwFlags dd ? wShowWindow dw ? cbReserved2 dw ? lpReserved2 dd ? hStdInput dd ? hStdOutput dd ? hStdError dd ? End_CB: ..... mov [cb],End_CB-pr_info ..... invoke CreateProcess,0,esi,NULL,NULL,NULL,NULL,NULL,NULL,st_info,pr_info ..... |
|||
![]() |
|
ChrisLeslie 04 Oct 2006, 04:26
Thankyou to all who replied.
I have fully initialised all the struct members, and remembered to put in the square brackets (stupid me!!) and run the application continuously for a period of six hours so far with no loss of memory. Looks like that problem has just bitten the dust. ![]() It is important to not consume any memory in this application because when it is finally put to real use it will be running 24-7 in a data colection environment (actually, collecting Alpha particle emissions from soil samples and processing to radionuclide activities) Regards Chris |
|||
![]() |
|
madmatt 04 Oct 2006, 07:57
Glad I could help.
![]() ![]() ![]() ![]() |
|||
![]() |
|
f0dder 04 Oct 2006, 12:20
WaitForSingleObject on [pr_info.hProcess] instead of polling GetExitCodeProcess... and never copy code from m32lib again.
|
|||
![]() |
|
ChrisLeslie 04 Oct 2006, 22:18
fOdder
1) The reason that the code resembles m32lib is that my project started using MASM. Then for various reasons I switched to FASM which required translation of the existing application code. The reuseable common procedures, which I put in a seperate include file, were all re-started in FASM from scratch except for about five of them which got translated from m32lib. I make no appologies for that. 2) Can you explain why you suggest WaitForSingleObject over GetExitCodeProcess? Regards Chris |
|||
![]() |
|
f0dder 04 Oct 2006, 23:16
#1: be careful with anything that originates from the m32lib, since it's poorly "designed" and full of sub-optimal and bugged crap.
#2: because it's more optimal. When using the WAIT functions, your thread is moved off the ready-list and thus takes up 0% CPU processing time. No Sleep() hacks are needed (and they are needed in the GECP polling, unless you want to suffer abysmal performance). Also, of academic fun value, consider a program that does ExitProcess with the same value as STILL_ACTIVE ![]() _________________ ![]() |
|||
![]() |
|
vid 05 Oct 2006, 07:31
to M32LIB:
- DF is not preserved upon calls (memcopy, lcase) - functions often access memory which they are not told to access, possibly causing GPF (memfill, strlen) - functions not working for boundary values (revstr) - leaks handles (filesize, imalloc) - doesn't check if arguments are within bounds (locate) - doesn't check for (not-obvious) errors returned by API calls (locate) - improperly uses COM objects (imalloc) - some procedures doesn't work at all, under any circumstances always crashes. this means they weren't even runned (stripx) in fact, i found bug in almost every function i looked at (in 9 of 11). And the others, without bug, were at least badly designed, like allowing overflow etc. i was looking at it here: http://www.cecs.csulb.edu/~hill/cecs325/MASM32/M32LIB/, probably there is newer version, but even realeasing something of this quality says a lot about author(s). |
|||
![]() |
|
f0dder 05 Oct 2006, 08:20
vid: you ought to take a look at most recent version, at least some bugs have been fixed - although a lot won't, because hutch is a stubborn idiot
![]() |
|||
![]() |
|
vid 05 Oct 2006, 09:41
gimme direct link please
|
|||
![]() |
|
f0dder 05 Oct 2006, 09:58
I'll give you a link to a "legacy version" as he calls it - which means a winrar sfx so you don't have to deal with his crappy installer. (Which is the reason he keeps a "legacy" version anyway, since for some reason he can't figure out how to make an installer than works on both 9x and NT). Also notice how he depends on other people to host his files? </rant>
|
|||
![]() |
|
comrade 07 Oct 2006, 15:58
jokes
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.