News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Type: PCTSTR & PTSTR

Started by bomz, April 19, 2011, 12:23:58 PM

Previous topic - Next topic

dedndave

IFNDEF URL_UNESCAPE_INPLACE
URL_UNESCAPE_INPLACE EQU 100000h
ENDIF
;
;
;
        INVOKE  UrlUnescape,eax,addr String,addr cbBuffer,URL_UNESCAPE_INPLACE


you told it not to unescape extra data

bomz

Thanks. I don't see all this falgs in MSDN and think to ask except try all flags

dedndave

yah - you have to google around a little bit   :P
but, it's defined in Shlwapi.h

dedndave

actually, because you are using 2 seperate buffers, i think you might try this...
        INVOKE  UrlUnescape,eax,addr String,addr cbBuffer,NULL

bomz


bomz

Quote
invoke InternetSetFilePointer, hUrl, FilePointerMoveLow, NULL, FilePointerMoveHigh, FILE_BEGIN, NULL
.if eax == INVALID_SET_FILE_POINTER
invoke MessageBox,0,0,0,0
.endif

Quote
invoke InternetSetFilePointer, hUrl, FilePointerMoveLow, NULL, FilePointerMoveHigh, FILE_BEGIN;, NULL
.if eax == INVALID_SET_FILE_POINTER
invoke MessageBox,0,0,0,0
OK
http://msdn.microsoft.com/en-us/library/aa385113%28v=vs.85%29.aspx
Quote
DWORD InternetSetFilePointer(
  __in     HINTERNET hFile,
  __in     LONG lDistanceToMove,
  __in     PVOID pReserved,
  __inout  PLONG lpDistanceToMoveHigh,
  __in     DWORD dwMoveMethod,
  __in     DWORD_PTR dwContext
);


This is error in MASM include file???

bomz

include \MASM32\include\wininet.inc
Quote
InternetSetFilePointer PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD
and if this is the error how decide which parameter is lost. may be add one? ,:DWORD 

Quote
InternetSetFilePointer PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD

bomz

Quoteinvoke InternetSetFilePointer, hUrl, NULL, NULL, FILE_CURRENT, NULL
.if eax == INVALID_SET_FILE_POINTER
invoke MessageBox,0,0,0,0
.endif
   invoke wsprintf,addr Buffer,Mess,eax
   invoke MessageBox, NULL, addr Buffer, NULL, MB_ICONASTERISK

THIS PARAMETRE IS LOST
QuotepReserved [in]

    This parameter is reserved and must be NULL.

dedndave

it appears as though InternetSetFilePointer is improperly PROTOtype in wininet.inc
according to MSDN, it has 6 dword parameters:
DWORD InternetSetFilePointer(
  __in     HINTERNET hFile,
  __in     LONG lDistanceToMove,
  __in     PVOID pReserved,
  __inout  PLONG lpDistanceToMoveHigh,
  __in     DWORD dwMoveMethod,
  __in     DWORD_PTR dwContext
);


but, if we look in wininet.inc, it only has 5:
InternetSetFilePointer PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD

i would modify wininet.inc and make a note of it

bomz

Where I may download version of MASM32 with ALL modification? Here http://www.masm32.com/masmdl.htm the version which I download some(?) years ago

dedndave

we have all been waiting patiently for Hutch to update it   :bg

when you find these kinds of errors, it's good to create a thread in this sub-forum:
http://www.masm32.com/board/index.php?board=7.0
(note: i searched that subform first thing to see if it had been mentioned)
that's not necessarily a guarantee that it will get added - lol
but, when someone uses the advanced search tool (limits search to that sub-form), they can find corrected information

bomz

One LITTLE question. I make download manager, as you may understand already, I find a lot of examples how download file from internet using WinInet, but I have a problem - my program can't download files approximately more than 2 gig from quick servers - LOCAL for me. What may be a reason of this? I may download small (700-1000+mb) files from this server, I may download 4 gig files from NOTLOCAL servers...
InternetReadFile read 0 bytes.

bomz

Something else - FtpGetFileSize don't back highword of file size. Somebody use WinInet. all OK in masm32 with wininet?

Quote
   .386
   .model flat,stdcall
   option casemap:none

   include \masm32\include\windows.inc
   include \masm32\include\user32.inc
   include \masm32\include\kernel32.inc
   include \masm32\include\wininet.inc
   includelib \masm32\lib\user32.lib
   includelib \masm32\lib\kernel32.lib
   includelib \masm32\lib\wininet.lib

.data
   UserAgent   db 'Mozilla/4.0 (compatible; MSIE 6.0b; Windows NT 5.0; .NET CLR 1.0.2914)',0
form            db 'Size %u',0
AReg            WORD64 ?
BReg            LONG64 ?
CReg            dt ?
DReg            dt ?

   site_name   db 'ftp.site.com',0
   file_name   db 'Detektiv.Di.2010.x264.BDRip.720p.mkv',0
   user_name   db 'anonymous',0
   password   db '111111',0

.data?
   hInternet   dd ?
   hConnect   dd ?
   hRequest   dd ?
   Bufferlen   dd ?
   Buffer      db 65536 dup(?)
   fHand      dd ?
   bwrite      dd ?

.code
start:

   invoke InternetOpen, addr UserAgent,INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, NULL
        test eax, eax
        jz exit1
   mov hInternet,eax
   invoke InternetConnect,hInternet, addr site_name,INTERNET_DEFAULT_FTP_PORT, addr user_name, addr password,INTERNET_SERVICE_FTP, 0, 0
        test eax, eax
        jz exit2
   mov hConnect,eax
   invoke FtpOpenFile, hConnect, addr file_name, GENERIC_READ, INTERNET_FLAG_TRANSFER_BINARY, NULL
   mov hRequest,eax
        test eax, eax
        jz exit3
   invoke FtpGetFileSize,hRequest, addr Bufferlen
   mov dword ptr[BReg], eax

   invoke wsprintf,addr Buffer,addr form, Bufferlen
   invoke MessageBox, NULL, addr Buffer, addr site_name, MB_ICONASTERISK
;invoke MessageBox,0,0,0,0
   invoke InternetCloseHandle, hRequest
exit3:

   invoke InternetCloseHandle, hConnect
exit2:

   invoke InternetCloseHandle, hInternet
exit1:

   invoke ExitProcess,eax
end start

qWord

So what did it return for the high order DWORD? For each file smaller than ~4.2GB it should return zero.
FPU in a trice: SmplMath
It's that simple!