BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SOLVED: CGI application on IIS 6.0 Win 2003

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Isapi-WebBroker
View previous topic :: View next topic  
Author Message
Frits Regtien
Guest





PostPosted: Tue Sep 02, 2003 3:07 pm    Post subject: SOLVED: CGI application on IIS 6.0 Win 2003 Reply with quote



In a few previous posts some people (including myself) found problems with
executing CGI programs using IIS 6.0.
You could get a message like "Access violation at address 77F4831D in module
'ntdll.dll'".

Thanks to Jesper Bang Jensen who gave me this bug fix on Borland Quality
Central. I would like to share his solution here:

Locate SysUtil.pas. Edit definition of GetEnvironmentVariable as below and
place it in lib-folder.

function GetEnvironmentVariable(const Name: string): string;
var
Len: integer;
W : String;//Jb 14.8.03 Server 2003 CGI-fix
begin
Result := '';
SetLength(W,1);//Jb 14.8.03 Server 2003 CGI-fix
Len := GetEnvironmentVariable(PChar(Name), PChar(W), 1); //Jb 14.8.03
Server 2003 CGI-fix
// Len := GetEnvironmentVariable(PChar(Name), Nil, 0);
if Len > 0 then
begin
SetLength(Result, Len - 1);
GetEnvironmentVariable(PChar(Name), PChar(Result), Len);
end;
end;

It didn't break when testing with an older version of IIS.

Groetjes,
Frits.


Back to top
Andrew Stead
Guest





PostPosted: Thu Sep 04, 2003 11:27 am    Post subject: Re: SOLVED: CGI application on IIS 6.0 Win 2003 Reply with quote



Frits,

Many thanks for your solution since it is the first update I have seen
to this problem in 2 months. Unfortunately, your solution does not
work for the problem that we are having here.

The problem that we are experiencing is in the

LStrToPChar

routine in System.pas. The problem seems to be when it is converting
LStr to PChars as was shown up by your problem. Your solution is a
high level solution to the low level problem.

Does anyone know any solutions to this particular problem. We are
currently porting our application from CGI to DLL but this is not a
simple nor quick job so any interim solutions would be greatfully
appreciated.

Please post any replies to the newsgroup since my email address is no
longer valid.

Many thanks

Andrew Stead


"Frits Regtien" <newgroups.borland (AT) firstsoftware (DOT) nl> wrote

Quote:
In a few previous posts some people (including myself) found problems with
executing CGI programs using IIS 6.0.
You could get a message like "Access violation at address 77F4831D in module
'ntdll.dll'".

Thanks to Jesper Bang Jensen who gave me this bug fix on Borland Quality
Central. I would like to share his solution here:

Locate SysUtil.pas. Edit definition of GetEnvironmentVariable as below and
place it in lib-folder.

function GetEnvironmentVariable(const Name: string): string;
var
Len: integer;
W : String;//Jb 14.8.03 Server 2003 CGI-fix
begin
Result := '';
SetLength(W,1);//Jb 14.8.03 Server 2003 CGI-fix
Len := GetEnvironmentVariable(PChar(Name), PChar(W), 1); //Jb 14.8.03
Server 2003 CGI-fix
// Len := GetEnvironmentVariable(PChar(Name), Nil, 0);
if Len > 0 then
begin
SetLength(Result, Len - 1);
GetEnvironmentVariable(PChar(Name), PChar(Result), Len);
end;
end;

It didn't break when testing with an older version of IIS.

Groetjes,
Frits.

Back to top
Andrew Stead
Guest





PostPosted: Thu Sep 04, 2003 11:28 am    Post subject: Re: SOLVED: CGI application on IIS 6.0 Win 2003 Reply with quote



Frits,

Many thanks for your solution since it is the first update I have seen
to this problem in 2 months. Unfortunately, your solution does not
work for the problem that we are having here.

The problem that we are experiencing is in the

LStrToPChar

routine in System.pas. The problem seems to be when it is converting
LStr to PChars as was shown up by your problem. Your solution is a
high level solution to the low level problem.

Does anyone know any solutions to this particular problem. We are
currently porting our application from CGI to DLL but this is not a
simple nor quick job so any interim solutions would be greatfully
appreciated.

Please post any replies to the newsgroup since my email address is no
longer valid.

Many thanks

Andrew Stead

"Frits Regtien" <newgroups.borland (AT) firstsoftware (DOT) nl> wrote

Quote:
In a few previous posts some people (including myself) found problems with
executing CGI programs using IIS 6.0.
You could get a message like "Access violation at address 77F4831D in module
'ntdll.dll'".

Thanks to Jesper Bang Jensen who gave me this bug fix on Borland Quality
Central. I would like to share his solution here:

Locate SysUtil.pas. Edit definition of GetEnvironmentVariable as below and
place it in lib-folder.

function GetEnvironmentVariable(const Name: string): string;
var
Len: integer;
W : String;//Jb 14.8.03 Server 2003 CGI-fix
begin
Result := '';
SetLength(W,1);//Jb 14.8.03 Server 2003 CGI-fix
Len := GetEnvironmentVariable(PChar(Name), PChar(W), 1); //Jb 14.8.03
Server 2003 CGI-fix
// Len := GetEnvironmentVariable(PChar(Name), Nil, 0);
if Len > 0 then
begin
SetLength(Result, Len - 1);
GetEnvironmentVariable(PChar(Name), PChar(Result), Len);
end;
end;

It didn't break when testing with an older version of IIS.

Groetjes,
Frits.

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Isapi-WebBroker All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.