Browsing through the masm32.lib source files I found an implementation of a function to check the existence of a file that uses FindFirstFile, and simply returns the handle without closing it... doesn't this cause a memory leak? Though Windows should close the handle on program exit, it could be a problem if the function is used extensively by an app. Please tell me if I'm right (perhaps I'm missing something here :confused: ).
Anyway, here's my version. Does the same, but it closes the handle before returning.

; Exists
; by QvasiModo

; Checks if a file exists
; Returns 0 if it doesn't exist, nonzero if it does.

; Se fija si un archivo existe
; Devuelve 0 si no existe, distinto de 0 si existe

Exists proto :dword

Exists proc lpszFile
local exists_w32fd:WIN32_FIND_DATA
invoke FindFirstFile,lpszFile,addr exists_w32fd
push eax
invoke FindClose,eax
pop eax
inc eax
Exists endp
Posted on 2003-08-19 13:24:03 by QvasiModo
You are right, I have already informed Hutch of this and it will (or has) been taken care of.
Posted on 2003-08-19 14:31:22 by donkey

I do wonder at the virtue of the double posting in both forums when Donkey has already fixed the problem after reporting it. The module has had the handle closed and it will be distributed with the next update of the entire library.

Because of the bandwidth used by the MASM32 package it is not easy to do fast changes to the package but the technical data has already been posted.

Posted on 2003-08-19 19:38:38 by hutch--
hutch-- if you need or want a mirror link for the MASM LIBS and stuff i can put it onto my PUB FTP and you can link to it..
Posted on 2003-08-19 20:14:53 by devilsclaw

thanks for the offer, the problem is the MASM32 package requires large bandwidth and it is carried by a number of people who are helping with it.

My own site has about 40 gig a month spare but to do the update, it has to be changed on all of the servers that help with the bandwidth.

I am doing other work on the library at the moment and while i have the binaries finished, I still have to rewrite the help file and when its ready I will post it at the masm forum. Large scale updates to the whole package are a lot more complicated to do now so I will have to think about it for a while.

Posted on 2003-08-20 04:16:51 by hutch--
hutch-- i dont know if you have or havent thought or done this yet...

but why dont you make a IDE type program for you MASM project..

so it has project files.. databases of known structures auto complete...

this way you can orginize the project diffrently... double structures and other doubles would not show up...

and then when you want to releass it just have the problem assemble the file/files to what you want...

there are a couple ways i was thinking... one based on a database style projects or if your just going to make it sort of generic to the MASM lib project you could make it baesed one file name or sub directories which can get messy..

im not good at explaining ideas so i hope you understand what i mean... i think this would help you..
Posted on 2003-08-20 14:46:55 by devilsclaw

You are right, I have already informed Hutch of this and it will (or has) been taken care of.

Sorry, should have thought of searching the board...
Posted on 2003-08-20 16:29:23 by QvasiModo

I am not an IDE type programmer and I personally only write software in an editor that I can configure which is what I supply with MASM32. Both Ketil Olsen and Ewayne Wagner provide an IDE so the range is there for programmers who want this style of coding.

The library format is very hard to improve on as its simple, has a seperate module for every function and can be rebuilt in place if changes are required or another module is added.

With a package that has been around as long as MASM32, it would be a major melodrama to change it structurally as it would break a lot of code but the other factor is it is reliable and authodox and the change runs the risk of losing both.

Posted on 2003-08-20 20:51:19 by hutch--