The MASM Forum

Toddler's Corner => Romper Room => Topic started by: morgot on July 10, 2020, 08:57:46 AM

Title: Memory error in Masm32Lib on Windows2008!
Post by: morgot on July 10, 2020, 08:57:46 AM

I have strange error in masm32lib , only on Windows Server 2008 R2. I don’t know if this is necessary here, whether someone can reproduce the error, but just in case I will write.
It crashes in GlobalFree (called from ucGetCL ). If I nop it - it crashes in CreateProcess.

Program work correctly on Windows 10, Windows Server 2012, but crashes on R2..

Code: [Select]
.model flat,stdcall
option casemap:none

include \masm32\include\
include \masm32\macros\macros.asm
uselib kernel32,user32,masm32

szProg dw 256 dup(0)


invoke ucGetCL,addr szProg,255,1
.if eax != 1
invoke StdOut,chr$("Error usage")
invoke StdOut,chr$("this_prog tested_prog")
jmp @ex

push ebx
xor ebx,ebx
mov s_i.cb,sizeof STARTUPINFOW
invoke CreateProcessW,addr szProg,ebx,ebx,ebx,ebx,ebx,ebx,ebx,addr s_i,addr p_i
pop ebx
.if !eax
fn MessageBox,0,LastError$(),"Last Error Text",MB_OK
jmp @ex
invoke WaitForSingleObject,p_i.hProcess,INFINITE

end start