Hi all,
I am trying to create an ISAPI filter to check the current user to see if they have administrative rights to edit pages on the server.. If so, I want to display 3 links at the top of any page that is displayed: EDIT, UPLOAD, UNDO.
The authentication seems to work without any problems.. Now the problem lies within the section that I need to add the links.. 1 of 3 things happen each time I try it:
1) My links do not show..
2) Links do show up, but cuts off the bottom part of all the pages (Content-Length: issue?)
3) The IIS service crashes and needs to be restarted.
Here is the code more recent code I am using to display the links.. I've also tried the WriteClient which doesn't work as well.. ANY HELP would be appreciated..!!
Oh yeah.. I'm using Visual C++ 6.0 to compile.. (if that makes any difference at all)
DWORD CEditNewFilter::OnSendRawData(CHttpFilterContext* pCtxt,
PHTTP_FILTER_RAW_DATA pRawData)
{
LPTSTR Txt="";
DWORD dwSize = pRawData->cbInData;
char* nTxt="";
dwSize += 34;
Txt = (LPTSTR)pRawData->pvInData;
if (strstr(Txt,"<body"
)
{
PHTTP_FILTER_RAW_DATA nRaw;
memset( &nRaw, 0, sizeof(nRaw) );
nRaw->pvInData = pCtxt->AllocMem(dwSize, 0 );
nRaw->cbInBuffer = dwSize;
wsprintf(nTxt,"%s %s",Edit_Text,Edit_Text);
strcat((char*)nRaw->pvInData,nTxt);
pRawData->cbInBuffer = nRaw->cbInBuffer;
pRawData->cbInData = nRaw->cbInData;
pRawData->pvInData = nRaw->pvInData;
}
return SF_STATUS_REQ_NEXT_NOTIFICATION;
}
Cheers,
G.
I am trying to create an ISAPI filter to check the current user to see if they have administrative rights to edit pages on the server.. If so, I want to display 3 links at the top of any page that is displayed: EDIT, UPLOAD, UNDO.
The authentication seems to work without any problems.. Now the problem lies within the section that I need to add the links.. 1 of 3 things happen each time I try it:
1) My links do not show..
2) Links do show up, but cuts off the bottom part of all the pages (Content-Length: issue?)
3) The IIS service crashes and needs to be restarted.
Here is the code more recent code I am using to display the links.. I've also tried the WriteClient which doesn't work as well.. ANY HELP would be appreciated..!!
Oh yeah.. I'm using Visual C++ 6.0 to compile.. (if that makes any difference at all)
DWORD CEditNewFilter::OnSendRawData(CHttpFilterContext* pCtxt,
PHTTP_FILTER_RAW_DATA pRawData)
{
LPTSTR Txt="";
DWORD dwSize = pRawData->cbInData;
char* nTxt="";
dwSize += 34;
Txt = (LPTSTR)pRawData->pvInData;
if (strstr(Txt,"<body"
{
PHTTP_FILTER_RAW_DATA nRaw;
memset( &nRaw, 0, sizeof(nRaw) );
nRaw->pvInData = pCtxt->AllocMem(dwSize, 0 );
nRaw->cbInBuffer = dwSize;
wsprintf(nTxt,"%s %s",Edit_Text,Edit_Text);
strcat((char*)nRaw->pvInData,nTxt);
pRawData->cbInBuffer = nRaw->cbInBuffer;
pRawData->cbInData = nRaw->cbInData;
pRawData->pvInData = nRaw->pvInData;
}
return SF_STATUS_REQ_NEXT_NOTIFICATION;
}
Cheers,
G.