The SDK says the following:


FindFirstUrlCacheEntryEx Function

--------------------------------------------------------------------------------

Starts a filtered enumeration of the Internet cache.

Syntax

HANDLE FindFirstUrlCacheEntryEx( LPCSTR lpszUrlSearchPattern,
DWORD dwFlags,
DWORD dwFilter,
GROUPID GroupId,
LPINTERNET_CACHE_ENTRY_INFO lpFirstCacheEntryInfo,
LPDWORD lpdwFirstCacheEntryInfoBufferSize,
LPVOID lpReserved,
LPDWORD pcbReserved2,
LPVOID lpReserved3
);
Parameters

lpszUrlSearchPattern
BSTR that contains the search pattern. Search patterns are currently not supported, so the value must be set to NULL to indicate all entries with the matching GROUPID.
dwFlags
Unsigned long integer value that contains the flags controlling the enumeration. No flags are currently implemented; this must be set to 0.
dwFilter
Unsigned long integer value that indicates the cache entry types that are allowed. This can be any combination of cache entry types:
COOKIE_CACHE_ENTRY
Cookie cache entry.
NORMAL_CACHE_ENTRY
Normal cache entry; can be deleted to recover space for new entries.
STICKY_CACHE_ENTRY
Sticky cache entry; exempt from scavenging.
TRACK_OFFLINE_CACHE_ENTRY
Not currently implemented.
TRACK_ONLINE_CACHE_ENTRY
Not currently implemented.
URLHISTORY_CACHE_ENTRY
Visited link cache entry.
GroupId
GROUPID value that indicates the cache group to enumerate. Set the value to 0 to enumerate all entries that are not grouped.
lpFirstCacheEntryInfo
Pointer to the buffer to hold the INTERNET_CACHE_ENTRY_INFO structure in which the cache entry information will be stored.
lpdwFirstCacheEntryInfoBufferSize
Pointer to an unsigned long integer variable that indicates the size of lpFirstCacheEntryInfo, in bytes.
lpReserved
Reserved. Must be set to NULL.
pcbReserved2
Reserved. Must be set to NULL.
lpReserved3
Reserved. Must be set to NULL.
Return Value

Returns a valid handle if successful, or NULL otherwise. To get specific error information, call GetLastError. If the function finds no matching files, GetLastError returns ERROR_NO_MORE_FILES.

Remarks

At the end of the enumeration, the application should call FindCloseUrlCache.

Function Information

Stock Implementation wininet.dll
Custom Implementation No
Header Wininet.h
Import library Wininet.lib
Minimum availability Internet Explorer 4.0
Minimum operating systems Windows NT 4.0, Windows 95, Windows CE 2.12


--------------------------------------------------------------------------------


It shows nine parameters for this call. MASM32 says "error A2137: too few arguments to INVOKE"


Wininet.inc says:

FindFirstUrlCacheEntryExA PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD
FindFirstUrlCacheEntryEx equ <FindFirstUrlCacheEntryExA>


There are 10 parameters in the proto.

--------------------------------------------------------------------------------







How do I get this thing to work?
Thank you.
Posted on 2003-12-17 13:16:52 by JOHNLOGIC
don't know about this function, but SDK and several examples talk about 9 DWORD parameters. Probably masm32 wininet.inc has a parameter more for some strange reason. Try remove a :DWORD, try call the function, see if crash and see the result in eax with a debugger. I think it should work with 9 params :)

B7
Posted on 2003-12-17 14:32:54 by Bit7
If I add an extra null to the call it assembles. When it runs I get error code 87 - The parameter is incorrect.

If I remove a dword from the proto it does not assemble.

PICKS.obj : error LNK2001: unresolved external symbol _FindFirstUrlCacheEntryExA@36
PICKS.exe : fatal error LNK1120: 1 unresolved externals

Make error(s) occured.
Posted on 2003-12-17 22:05:16 by JOHNLOGIC
ok, so also the .lib file that's used to link is 10 parameters... maybe you can try to create a new wininet.lib from the dll with some masm32 command line tool (i use tasm, so my tool is imp2lib). Then, the new lib file should respect the 9 parameters format.

B7
Posted on 2003-12-18 01:16:31 by Bit7
To change a lib in masm, first change the proto in the INC file (add your extra dword) then use inc2lib to build a new lib file. That will take care of the error.
Posted on 2003-12-18 01:20:57 by donkey
I del one dword from the proto and use inc2l to create the new lib. I get the same error msg.

PICKS.obj : error LNK2001: unresolved external symbol _FindFirstUrlCacheEntryExA@36
PICKS.exe : fatal error LNK1120: 1 unresolved externals

Make error(s) occured.


Then I use l2inc to get the inc from the lib and find no proto for FindFirstUrlCacheEntryEx.

If I use l2inc on the old lib the proto is there with 10 dwords.
Posted on 2003-12-18 14:16:27 by JOHNLOGIC
you could always just use push and call.
Posted on 2003-12-18 14:47:41 by ENF
I tried it and it seems to have worked the first time out. Be sure to copy the lib file to the LIB folder in order for the linker to find it.

I used inc2l wininet.inc
Posted on 2003-12-18 16:14:36 by donkey
If I use your inc and lib it assembles but I still get "error code 87 - The parameter is incorrect" when I run it. NOTE: your wininet.lib is 50,532 bytes, mine is 143,534 dated 10/30/03.
I think there may be something wrong with my prog. It looks good to me but here are the relevant parts.



.DATA
E_CACHE_BUF EQU 1024
I EQU Invoke
CACHE_INFO INTERNET_CACHE_ENTRY_INFO <>
CACHE_BUF DB E_CACHE_BUF DUP (0)
CACHE_BUF_SIZE DD (SIZEOF CACHE_INFO)+E_CACHE_BUF
CACHE_HAND DD 0
.code

I FindFirstUrlCacheEntryEx,NULL,NULL,NORMAL_CACHE_ENTRY,NULL,\
addr CACHE_INFO,addr CACHE_BUF_SIZE,NULL,NULL,NULL

"error code 87 here"
Posted on 2003-12-18 22:19:37 by JOHNLOGIC
Well, the reduced size is nothing I can comment on, the files work. For the error code maybe check the parameters you are passing in INTERNET_CACHE_ENTRY_INFO. The ERROR_INVALID_PARAMETER (ec#87) is a windows error so the call was sucessful outside of that I don't know what you have to pass.
Posted on 2003-12-18 22:38:12 by donkey
There are no parametes in INTERNET_CACHE_ENTRY_INFO. It is filled in by the call.

lpFirstCacheEntryInfo
Pointer to the buffer to hold the INTERNET_CACHE_ENTRY_INFO structure in which the cache entry information will be stored.
Posted on 2003-12-18 22:54:32 by JOHNLOGIC

There are no parametes in INTERNET_CACHE_ENTRY_INFO. It is filled in by the call.

lpFirstCacheEntryInfo
Pointer to the buffer to hold the INTERNET_CACHE_ENTRY_INFO structure in which the cache entry information will be stored.

Can't help there, I used this same method to rebuild much of the masm32 library and have no problems with it at all so the Windows error is in your program somewhere. I have never used the function (or the wininet lib) so I can't comment. I have rebuilt user32, kernel32 and shell32 with inc2l so I know that it works, besides that sorry.
Posted on 2003-12-18 23:29:36 by donkey
OK, thank you. If I ever solve the problem I'll post it here.
Posted on 2003-12-18 23:36:46 by JOHNLOGIC