RasAdminDLL + EventID 7031
0 отговора
36 прегледа
RasAdminDLL + EventID 7031
Здравейте!
Опитвам се да напиша DLL, за допълнително администриране на RAS-а
[линк]
За съжаление, когато във процедурите/функциите добавих някаква функционалност различна от това да се отбелязва в ApplicationLog-а, че RAS-са се е обърнал към нея, се получи следният неприятен ефект:
Event Type: Error
Event Source: Service Control Manager
Event Category: None
Event ID: 7031
Date: 11.11.2003 ?.
Time: 17:20:49
User: N/A
Computer: w2k
Description:
The COM+ Event System service terminated unexpectedly.
It has done this 1 time(s). The following corrective action will
be taken in 0 milliseconds: No action.
Последвано от още 5 грешки със същото EventID, но различен description, а именно:
Description:
The Network Connections service terminated unexpectedly.
It has done this 1 time(s). The following corrective action will
be taken in 0 milliseconds: No action.
Description:
The Removable Storage service terminated unexpectedly.
It has done this 1 time(s). The following corrective action will
be taken in 0 milliseconds: No action.
Description:
The Remote Access Connection Manager service terminated unexpectedly.
It has done this 1 time(s). The following corrective action will be
taken in 0 milliseconds: No action.
Description:
The Routing and Remote Access service terminated unexpectedly.
It has done this 1 time(s). The following corrective action will
be taken in 0 milliseconds: No action.
Description:
The System Event Notification service terminated unexpectedly.
It has done this 1 time(s). The following corrective action
will be taken in 0 milliseconds: No action.
След което RAS-a се скапва.
А! Значи това става още при извикване на първата от функциите които се викат при опит за разписване - MprAdminGetIpAddressForUser. И доколкото мога да преценя тя приключва успешно, но към следващата MprAdminGetIpAddressForUser, не се обръща... Т.е. нещо се случва /вероятно/ след връщането от функиция, или /понеже аз съм я писал/ най-вероятно не е коректно самото връщане.
И последно. Опитвам се да го направя на Delphi /нямам MS Visual Studio в момента за да проверя там как биха изглеждали нещата/.
Процедурата изглежда така:
function MprAdminGetIpAddressForUser(UserName:string) : double; export; stdcall;
var
f : TextFile;
begin
AssignFile(f, 'c:\tmp\rasadmin.txt');
if FileExists('c:\tmp\rasadmin.txt')
then Append(f)
else ReWrite(f);
CloseFile(f);
ToEventLog('MprAdminGetIpAddressForUser', $4, 3, 1809, '');
MprAdminGetIpAddressForUser := 0;
end;
Ако от този код останат само последните два реда
ToEventLog('MprAdminGetIpAddressForUser', $4, 3, 1809, '');
MprAdminGetIpAddressForUser := 0;
RAS-a си върви нормално, и в лог-а се вижда че е викал функцията.
Някакви идеи за причините?
Благодаря!
Опитвам се да напиша DLL, за допълнително администриране на RAS-а
[линк]
За съжаление, когато във процедурите/функциите добавих някаква функционалност различна от това да се отбелязва в ApplicationLog-а, че RAS-са се е обърнал към нея, се получи следният неприятен ефект:
Event Type: Error
Event Source: Service Control Manager
Event Category: None
Event ID: 7031
Date: 11.11.2003 ?.
Time: 17:20:49
User: N/A
Computer: w2k
Description:
The COM+ Event System service terminated unexpectedly.
It has done this 1 time(s). The following corrective action will
be taken in 0 milliseconds: No action.
Последвано от още 5 грешки със същото EventID, но различен description, а именно:
Description:
The Network Connections service terminated unexpectedly.
It has done this 1 time(s). The following corrective action will
be taken in 0 milliseconds: No action.
Description:
The Removable Storage service terminated unexpectedly.
It has done this 1 time(s). The following corrective action will
be taken in 0 milliseconds: No action.
Description:
The Remote Access Connection Manager service terminated unexpectedly.
It has done this 1 time(s). The following corrective action will be
taken in 0 milliseconds: No action.
Description:
The Routing and Remote Access service terminated unexpectedly.
It has done this 1 time(s). The following corrective action will
be taken in 0 milliseconds: No action.
Description:
The System Event Notification service terminated unexpectedly.
It has done this 1 time(s). The following corrective action
will be taken in 0 milliseconds: No action.
След което RAS-a се скапва.
А! Значи това става още при извикване на първата от функциите които се викат при опит за разписване - MprAdminGetIpAddressForUser. И доколкото мога да преценя тя приключва успешно, но към следващата MprAdminGetIpAddressForUser, не се обръща... Т.е. нещо се случва /вероятно/ след връщането от функиция, или /понеже аз съм я писал/ най-вероятно не е коректно самото връщане.
И последно. Опитвам се да го направя на Delphi /нямам MS Visual Studio в момента за да проверя там как биха изглеждали нещата/.
Процедурата изглежда така:
function MprAdminGetIpAddressForUser(UserName:string) : double; export; stdcall;
var
f : TextFile;
begin
AssignFile(f, 'c:\tmp\rasadmin.txt');
if FileExists('c:\tmp\rasadmin.txt')
then Append(f)
else ReWrite(f);
CloseFile(f);
ToEventLog('MprAdminGetIpAddressForUser', $4, 3, 1809, '');
MprAdminGetIpAddressForUser := 0;
end;
Ако от този код останат само последните два реда
ToEventLog('MprAdminGetIpAddressForUser', $4, 3, 1809, '');
MprAdminGetIpAddressForUser := 0;
RAS-a си върви нормално, и в лог-а се вижда че е викал функцията.
Някакви идеи за причините?
Благодаря!