News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

GetFolders

Started by clamicun, December 12, 2017, 09:08:58 AM

Previous topic - Next topic

clamicun

Hi JJ,
I bought me a new machine ... Windows 10 Home 64b
By coincidence I used an old prog which contains:

Let esi="C:\"
GetFolders esi   
mov .....

The prog goes down badly.

Works fine on drive D and E which are much smaller.

Any idea ?

jj2007

What do you mean with "goes down badly"? It hangs, it throws an exception, ...?

On my Win7-64, I get over 100,000 folders without problems. I will investigate...

On Win10, Explorer chokes on a folder C:\Windows.old\WINDOWS\SOFTWA~1\Download\E6ED64~1\AMD64_~1.15\AM2F8C~1.15 _
Note the attempt to use DOS-style short names ::)

jj2007

Hi Clamicun,

It seems I found the culprit. Can you test the attached exe and post the result?

Thanks,
Jochen


On my Win10 home machine:
files#  eax             87796

GetFiles
stk_in          1702684
stk_out         1653512
stk_flen        566
stk_flen[4]     2080
ecx             49172

GetFiles
stk_in          0019FB1C
stk_out         00193B08
stk_flen        00000236

clamicun

Yes, it is C:\Windows.old which I do not succeed to delete ? ... MS is the owner of my new machine

clamicun

GetFilestest does it:  68433 files

clamicun

include \masm32\MasmBasic\MasmBasic.inc   ; requires jjRecTest lib version!
;include Include\cmc_macros.inc
Init
  Let esi="C:\"
  GetFolders esi
; show_value eax,"folders"
  deb 4, "files", eax
  Externdef   stk_in:DWORD
  Externdef   stk_out:DWORD
  Externdef   stk_flen:DWORD
  mov ecx, stk_in
  sub ecx, stk_out
  deb 4, "GetFiles", stk_in, stk_out, stk_flen, stk_flen[4], ecx
  usedeb=16
  deb 4, "GetFiles", stk_in, stk_out, stk_flen
  Inkey "ok?"
EndOfCode

OPT_Debug   1



I have to admit, I never understood the file.asc business.
This one in RichMasm.exe gives me:

POLINK: error: Unresolved external symbol '_stk_in'.
POLINK: error: Unresolved external symbol '_stk_out'.
POLINK: error: Unresolved external symbol '_stk_flen'.
POLINK: fatal error: 3 unresolved external(s).
*** Link error ***


jj2007

Quote from: clamicun on December 13, 2017, 04:00:55 AM
I have to admit, I never understood the file.asc business.

The source does not build because it requires a debug version of MasmBasic.lib
I have solved the issue, new lib attached (temporary, for testing), to build it you have to comment out the stk_?? bits.

clamicun

Thank you,
and btw.  I see Windows.old is removable with Disk Cleanup.
So the problem with GetFolders has vanished anyway.

jj2007

Congrats ;)
But there was a buffer overflow risk, and you helped me find it, thanks :icon14:
Btw it seems many people had problems with that folder, the web is full of desperate people trying to delete Windows.old :P