- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们在使用免费软件 MAPI/SMAPI 时遇到间歇性死锁执行。我怀疑该实现有问题,但也许将登录标志更改为 MapiLogon 或 Exchange 上的配置设置可以解决此问题。
Result := MapiLogon(0, LogonProfile, LogonPassword, flLogonFlags, 0, @hSession);
添加了 cudo 到@J
使用Simple MAPI完全灰心丧气。正确的操作是开始使用扩展 MAPI 或 Outlook 对象模型。虽然我同意这一说法,但我对实现这一目标没有任何影响力。
当前设置的解决方案或理解为什么可能发生死锁仍然非常受欢迎。
简而言之
0b60
调用MapiLogof
0894
0894
等待关键部分036c
036c
被线程0b60
锁定死锁
内核转储显示以下关键部分被线程 b60
锁定并拥有
CritSec EMSMDB32!ScStatClose+17ac7 at 354650d0 WaiterWoken No LockCount 1 RecursionCount 1 OwningThread b60 EntryCount 0 ContentionCount 1 *** Locked
Thread's 0b60
call stack
kernel thread object 88a53758
Note the KeWaitForSingleObject
with parameter 87fc3c68
being thread 0894
b8b4fcec 8093b2e4 87fc3c68 00000006 00000001 nt!KeWaitForSingleObject+0x346 (FPO: [Non-Fpo]) b8b4fd50 8088b658 00000184 00000000 00000000 nt!NtWaitForSingleObject+0x9a (FPO: [Non-Fpo]) b8b4fd50 7c82845c 00000184 00000000 00000000 nt!KiSystemServicePostCall (FPO: [0,0] TrapFrame @ b8b4fd64) 0012f618 7c827b79 77e61d06 00000184 00000000 ntdll!KiFastSystemCallRet (FPO: [0,0,0]) 0012f61c 77e61d06 00000184 00000000 00000000 ntdll!NtWaitForSingleObject+0xc (FPO: [3,0,0]) 0012f68c 77e61c75 00000184 ffffffff 00000000 kernel32!WaitForSingleObjectEx+0xac (FPO: [Non-Fpo]) 0012f6a0 3540fc13 00000184 ffffffff 02102150 kernel32!WaitForSingleObject+0x12 (FPO: [Non-Fpo]) 0012f6b4 3540a226 7c81a1a8 3540546f 02102108 EMSMDB32!XPProviderInit+0x58d5 0012f6bc 3540546f 02102108 00db29c0 0012f6f0 EMSMDB32!MSProviderInit+0x16af6 0012f6d0 3553ce40 02102108 35411e97 02102108 EMSMDB32!MSProviderInit+0x11d3f 00000000 00000000 00000000 00000000 00000000 MSMAPI32!UlRelease+0xe /* Reconstructed from MAP file */ 0012f878 00422b81 21B81 mailrequestserver+0x22b81 0001:00021B70 MapiLogoff 0012f894 00423dde 22DDE mailrequestserver+0x23dde 0001:00022DB0 TEmail.Logoff
Thread's 0894
call stack is
kernel thread object 87fc3c68
Note the EMSMDB32!ScStatClose
call resulting in RtlpWaitOnCriticalSection
with parameter 0000036c
being the critical section owned by thread 0b60
0231ff80 7c83d0f7 0000036c 00000004 00000000 ntdll!RtlpWaitOnCriticalSection+0x1a3 (FPO: [Non-Fpo]) 0231ffa0 3544d394 354650d0 00000000 00000001 ntdll!RtlEnterCriticalSection+0xa8 (FPO: [Non-Fpo]) 0231ff98 354650d0 EMSMDB32!ScStatClose+0x17ac7 0231ffa4 3544d394 EMSMDB32!EcUnregisterPushNotification+0x12033 0231ffa8 354650d0 EMSMDB32!ScStatClose+0x17ac7 0231ffb4 3544d114 EMSMDB32!EcUnregisterPushNotification+0x11db3
Question
UnregisterPushNotifications
involved. Searching for push notifications, I can't find any reason why we would need that (we just logon, send a mail and logof) but, as this happens entirely in MAPI, I don't know how we can prevent the call from happening.Some additional information
MSMAPI32.dll
is version 10.0.6861.0EMSMDB32.dll
is version 10.0.6742.0Relevant code from SMapi.pas
function MapiLogoff(lhSession : LHANDLE;
ulUIParam : ULONG;
flFlags : ULONG;
ulReserved : ULONG): ULONG;
function MapiLogon(ulUIParam : ULONG;
lpszName : PChar;
lpszPassword: PChar;
flFlags : ULONG;
ulReserved : ULONG;
lplhSession : LPLHANDLE): ULONG;
function MapiSendMail(lhSession : LHANDLE;
ulUIParam : ULONG;
lpMessage : lpMapiMessage;
flFlags : ULONG;
ulReserved : ULONG): ULONG;
procedure InitializeSMAPI;
var
OldErrorMode: Word;
OSVersionInfo: TOSVersionInfo;
RegHandle: HKEY;
MapiDetectBuf: array[0..8] of Char;
MapiDetectBufSize: Windows.DWORD;
RegValueType: Windows.DWORD;
begin
{ first check wether MAPI is available on the system; this is done
as described in the MS MAPI docs }
OSVersionInfo.dwOSVersionInfoSize := SizeOf(OSVersionInfo);
GetVersionEx(OSVersionInfo);
if (OSVersionInfo.dwMajorVersion > 3) or { NT 4.0 and later }
{ earlier than NT 3.51 }
((OSVersionInfo.dwMajorVersion = 3) and (OSVersionInfo.dwMinorVersion > 51)) then
begin
if RegOpenKeyEx( HKEY_LOCAL_MACHINE,
'SOFTWARE\Microsoft\Windows Messaging Subsystem',
0, KEY_READ, RegHandle) <> ERROR_SUCCESS then
begin
exit;
end;
MAPIDetectBufSize := SizeOf(MAPIDetectBuf);
if RegQueryValueEx( RegHandle, 'MAPI', nil, @RegValueType,
PByte(@MAPIDetectBuf), @MAPIDetectBufSize) <> ERROR_SUCCESS then
begin
exit;
end;
RegCloseKey(RegHandle);
{ "boolean" integer --> is == "1"? }
if not ((MAPIDetectBuf[0] = '1') and (MAPIDetectBuf[1] = #0)) then
exit;
end
else
if GetProfileInt('Mail', 'MAPI', 0) = 0 then { 16 bit and NT 3.51 detection logic }
Exit;
OldErrorMode := SetErrorMode(SEM_FAILCRITICALERRORS + SEM_NOOPENFILEERRORBOX);
DLLHandle := LoadLibrary(DLLName32); { start without .DLL attached }
{ OldErrorMode := } SetErrorMode(OldErrorMode);
if DLLHandle = 0 then { got an error }
begin
OldErrorMode := SetErrorMode(SEM_FAILCRITICALERRORS + SEM_NOOPENFILEERRORBOX);
try
DLLHandle := LoadLibrary(DLLName32DLL);
if DLLHandle = 0 then
begin
exit; { second attempt did not work out either }
end;
finally
{ OldErrorMode := } SetErrorMode(OldErrorMode);
end;
end;
begin
DllInitialized := true;
@FnMapiFindNext := GetProcAddress(DLLHandle, 'MAPIFindNext');
@FnMapiLogoff := GetProcAddress(DLLHandle, 'MAPILogoff');
@FnMapiLogon := GetProcAddress(DLLHandle, 'MAPILogon');
@FnMapiSendMail := GetProcAddress(DLLHandle, 'MAPISendMail');
@FnMapiReadMail := GetProcAddress(DLLHandle, 'MAPIReadMail');
@FnMapiDeleteMail := GetProcAddress(DLLHandle, 'MAPIDeleteMail');
@FnMapiResolveName := GetProcAddress(DLLHandle, 'MAPIResolveName');
@FnMapiFreeBuffer := GetProcAddress(DLLHandle, 'MAPIFreeBuffer');
@FnMapiAddress := GetProcAddress(DLLHandle, 'MAPIAddress');
@FnMapiSaveMail := GetProcAddress(DLLHandle, 'MAPISaveMail');
if (@FnMapiAddress = nil)
or (@FnMapiFreeBuffer = nil)
or (@FnMapiResolveName = nil)
or (@FnMapiDeleteMail = nil)
or (@FnMapiReadMail = nil)
or (@FnMapiSendMail = nil)
or (@FnMapiLogon = nil)
or (@FnMapiLogoff = nil)
or (@FnMapiFindNext = nil)
or (@FnMapiSaveMail = nil) then
begin
raise EMAPIdllerror.Create(SMapiGetProcAdressFailed);
end;
end;
end;
来自Email.pas的相关代码
destructor TEmail.Destroy;
begin
...
try
if hSession <> 0 then
Logoff;
except
end;
end;
function TEmail.Logon: Integer;
const
ProfileKey95 = 'Software\Microsoft\Windows Messaging Subsystem\Profiles';
ProfileKeyNT = 'Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles';
var
LogonProfile : PChar;
LogonPassword: PChar;
ProfileKey : PChar;
Reg : TRegistry;
begin
CheckMapi;
Result := SUCCESS_SUCCESS;
{ Check if already logged in. }
if hSession = 0 then
begin
if FUseDefProfile then
begin
Reg := TRegistry.Create;
try
{ get platform (Win95/NT) dependent profile key }
{ code added by Ulrik Schoth schoth@krohne.mhs.compuserve.com }
if Reg.KeyExists(ProfileKeyNT) then
begin
ProfileKey := ProfileKeyNT;
end
else
begin
ProfileKey := ProfileKey95;
end;
Reg.Rootkey := HKEY_CURRENT_USER;
if Reg.OpenKey(ProfileKey, False) then
begin
try
FProfile := Reg.Readstring('DefaultProfile');
except
FProfile := '';
end;
end;
finally
Reg.Free;
end;
end;
LogonProfile := nil;
LogonPassword := nil;
try
if Length(FProfile) > 0 then
begin
LogonProfile := StrPCopy(StrAlloc(Length(FProfile)+1), FProfile);
end;
if Length(FPassword) > 0 then
begin
LogonPassword := StrPCopy(StrAlloc(Length(FPassword)+1), FPassword);
end;
DoBeforeLogon;
Result := MapiLogon(0, LogonProfile, LogonPassword, flLogonFlags, 0, @hSession);
if Result <> SUCCESS_SUCCESS then
Result := MapiLogon(0, nil, nil, flLogonFlags or MAPI_Logon_UI, 0, @hSession);
if Result = SUCCESS_SUCCESS then
DoAfterLogon
else
DoMapiError(Result);
finally
StrDispose(LogonProfile);
StrDispose(LogonPassword);
end;
end;
end;
function TEmail.SendMailEx(DoSave: boolean): Integer;
var
MapiMessage : TMapiMessage;
MapiRecipDesc : TMapiRecipDesc;
MapiFileDesc : TMapiFileDesc;
lpRecipArray : TlpRecipArray;
lpAttachArray : TlpAttachArray;
lpszPathname : TlpszPathname;
lpszFileName : TlpszFileName;
szSubject : PChar;
szText : PChar;
szMessageId : PChar;
szMessageType : PChar;
Attachment : SString;
flFlags : ULONG;
flLogoff : Boolean;
i : Integer;
nRecipients : Integer;
nAttachments : Integer;
begin
CheckMapi;
{make sure the cleanup does not free garbage }
lpRecipArray := nil;
lpAttachArray := nil;
flLogoff := False;
{check our built-in limits - which have effectively been removed }
nRecipients := Frecip.Count + FCC.Count + FBCC.Count;
if nRecipients > RECIP_MAX then
begin
Result := MAPI_E_TOO_MANY_RECIPIENTS;
DoMapiError(Result);
exit;
end;
nAttachments := FAttachment.Count;
if nAttachments > ATTACH_MAX then
begin
Result := MAPI_E_TOO_MANY_FILES;
DoMapiError(Result);
exit;
end;
{ begin the work }
try
flLogoff := (hSession = 0);
{ Logon to mail server if not already logged on. }
if Logon <> SUCCESS_SUCCESS then
begin
Result := MAPI_E_LOGIN_FAILURE;
DoMapiError(Result);
exit;
end;
{ Initialise MAPI structures and local arrays. }
FillChar(MapiMessage, SizeOf(TMapiMessage), 0);
FillChar(MapiRecipDesc, SizeOf(TMapiRecipDesc), 0);
FillChar(MapiFileDesc, SizeOf(TMapiFileDesc), 0);
lpRecipArray := TlpRecipArray(StrAlloc(nRecipients*SizeOf(TMapiRecipDesc)));
FillChar(lpRecipArray^, StrBufSize(PChar(lpRecipArray)), 0);
lpAttachArray := TlpAttachArray(StrAlloc(nAttachments*SizeOf(TMapiFileDesc)));
FillChar(lpAttachArray^, StrBufSize(PChar(lpAttachArray)), 0);
{ Fill in subject & message text. }
szSubject := nil;
szText := nil;
szMessageId := nil;
szMessageType := nil;
try
if Length(FSubject) > 0 then
begin
szSubject := StrAlloc(length(FSubject) + 1);
StrPCopy(szSubject, FSubject);
end;
MapiMessage.lpszSubject := szSubject;
if Length(FText) > 0 then
begin
szText := StrAlloc(length(FText) + 1);
StrPCopy(szText, FText);
end;
MapiMessage.lpszNoteText := szText;
{ for non-IPM messages }
if Length(FMessageType) > 0 then
begin
szMessageType := StrAlloc(Length(FMessageType) + 1);
StrPCopy(szMessageType, FMessageType);
end;
MapiMessage.lpszMessageType := szMessageType;
if FpLongText <> nil then
MapiMessage.lpszNoteText := FpLongText;
{ check and fill in recipients if any}
nRecipients := 0;
ListToRecipArray(FRecip, MAPI_TO, lpRecipArray, nRecipients);
ListToRecipArray(FCC, MAPI_CC, lpRecipArray, nRecipients);
ListToRecipArray(FBcc, MAPI_BCC, lpRecipArray, nRecipients);
MapiMessage.nRecipCount := nRecipients;
flFlags := 0; { Don't display MAPI Dialog if recipient specified. }
MapiMessage.lpRecips := @lpRecipArray^;
{ Process file attachments. }
nAttachments := 0;
for i := 0 to (Fattachment.Count - 1) do
begin
Attachment := CheckAttachment(Fattachment.Strings[i]);
if Length(Attachment) = 0 then
begin
Result := MAPI_E_ATTACHMENT_NOT_FOUND;
DoMapiError(Result);
exit;
end;
lpAttachArray^[i].nPosition := Integer($FFFFFFFF); {Top of message. }
lpszPathname := new(TlpszPathname);
lpAttachArray^[i].lpszPathName := StrPcopy(lpszPathname^, Attachment);
{ begin code added by MJK }
lpszFileName := new(TlpszFileName);
{ truncate attachment filename if desired }
if FTruncAttFN then
begin
{ truncate }
lpAttachArray^[i].lpszFileName :=
StrPCopy(lpszFileName^, TruncAttachmentFN(ExtractFileName(Attachment)))
end
else
begin
{ leave alone }
lpAttachArray^[i].lpszFileName :=
StrPCopy(lpszFileName^, ExtractFileName(Attachment));
end;
{end code added by MJK}
Inc(nAttachments);
end;
MapiMessage.nFileCount := nAttachments;
if nAttachments > 0 then
begin
MapiMessage.lpFiles := @lpAttachArray^;
end
else
begin
MapiMessage.lpFiles := nil;
end;
{ receipt requested ? }
if FAcknowledge then
MapiMessage.flFlags := MapiMessage.flFlags or MAPI_RECEIPT_REQUESTED;
{ finally send the email message }
DoBeforeSendMail;
Result := MapiSendMail(hSession, 0, @MapiMessage, flFlags, 0);
if Result = SUCCESS_SUCCESS then
DoAfterSendMail
else
DoMapiError(Result);
finally
StrDispose(szSubject);
StrDispose(szText);
StrDispose(szMessageID);
StrDispose(szMessageType);
end;
finally
{ dispose of the recipient & CC name strings }
if Assigned(lpRecipArray) then
for i := 0 to (nRecipients - 1) do
begin
if Assigned(lpRecipArray^[i].lpszName) then
Dispose(lpRecipArray^[i].lpszName);
if Assigned(lpRecipArray^[i].lpszAddress) then
Dispose(lpRecipArray^[i].lpszAddress);
end;
{ dispose of the recipient/CC/BCC array }
StrDispose(PChar(lpRecipArray));
{ dispose of the attachment file name strings }
if Assigned(lpAttachArray) then
for i := 0 to (nAttachments - 1) do
begin
Dispose(lpAttachArray^[i].lpszPathname);
Dispose(lpAttachArray^[i].lpszFileName);
end;
{ dispose of the attachment array }
StrDispose(PChar(lpAttachArray));
{ Auto logoff, if no session was active. }
if flLogoff = True then
Logoff;
end;
end;
ps。我无法发布转储,它有 4GB,但请随时询问我可能遗漏的任何其他所需详细信息
最佳答案
我有机会得到一个友好团体对转储的分析。
结论是 (我的解释)
EMSMDB32.dll
中的错误,但代码太旧,很可能没有任何支持或意图修复它。EMSMDB32!EcUnregisterPushNotification+0x11db3
中的偏移量太大,因此可能不会执行 EcUnregisterPushNotification
方法。无法确定可能执行什么方法。可能的解决方案
由于我们不可能修复该错误(假设它是一个错误),因此以下解决方法适用于我们的情况
关于delphi - 使用 Simple MAPI TEmail 组件记录时出现死锁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24826421/
SQLite、Content provider 和 Shared Preference 之间的所有已知区别。 但我想知道什么时候需要根据情况使用 SQLite 或 Content Provider 或
警告:我正在使用一个我无法完全控制的后端,所以我正在努力解决 Backbone 中的一些注意事项,这些注意事项可能在其他地方更好地解决......不幸的是,我别无选择,只能在这里处理它们! 所以,我的
我一整天都在挣扎。我的预输入搜索表达式与远程 json 数据完美配合。但是当我尝试使用相同的 json 数据作为预取数据时,建议为空。点击第一个标志后,我收到预定义消息“无法找到任何内容...”,结果
我正在制作一个模拟 NHL 选秀彩票的程序,其中屏幕右侧应该有一个 JTextField,并且在左侧绘制弹跳的选秀球。我创建了一个名为 Ball 的类,它实现了 Runnable,并在我的主 Draf
这个问题已经有答案了: How can I calculate a time span in Java and format the output? (18 个回答) 已关闭 9 年前。 这是我的代码
我有一个 ASP.NET Web API 应用程序在我的本地 IIS 实例上运行。 Web 应用程序配置有 CORS。我调用的 Web API 方法类似于: [POST("/API/{foo}/{ba
我将用户输入的时间和日期作为: DatePicker dp = (DatePicker) findViewById(R.id.datePicker); TimePicker tp = (TimePic
放宽“邻居”的标准是否足够,或者是否有其他标准行动可以采取? 最佳答案 如果所有相邻解决方案都是 Tabu,则听起来您的 Tabu 列表的大小太长或您的释放策略太严格。一个好的 Tabu 列表长度是
我正在阅读来自 cppreference 的代码示例: #include #include #include #include template void print_queue(T& q)
我快疯了,我试图理解工具提示的行为,但没有成功。 1. 第一个问题是当我尝试通过插件(按钮 1)在点击事件中使用它时 -> 如果您转到 Fiddle,您会在“内容”内看到该函数' 每次点击都会调用该属
我在功能组件中有以下代码: const [ folder, setFolder ] = useState([]); const folderData = useContext(FolderContex
我在使用预签名网址和 AFNetworking 3.0 从 S3 获取图像时遇到问题。我可以使用 NSMutableURLRequest 和 NSURLSession 获取图像,但是当我使用 AFHT
我正在使用 Oracle ojdbc 12 和 Java 8 处理 Oracle UCP 管理器的问题。当 UCP 池启动失败时,我希望关闭它创建的连接。 当池初始化期间遇到 ORA-02391:超过
关闭。此题需要details or clarity 。目前不接受答案。 想要改进这个问题吗?通过 editing this post 添加详细信息并澄清问题. 已关闭 9 年前。 Improve
引用这个plunker: https://plnkr.co/edit/GWsbdDWVvBYNMqyxzlLY?p=preview 我在 styles.css 文件和 src/app.ts 文件中指定
为什么我的条形这么细?我尝试将宽度设置为 1,它们变得非常厚。我不知道还能尝试什么。默认厚度为 0.8,这是应该的样子吗? import matplotlib.pyplot as plt import
当我编写时,查询按预期执行: SELECT id, day2.count - day1.count AS diff FROM day1 NATURAL JOIN day2; 但我真正想要的是右连接。当
我有以下时间数据: 0 08/01/16 13:07:46,335437 1 18/02/16 08:40:40,565575 2 14/01/16 22:2
一些背景知识 -我的 NodeJS 服务器在端口 3001 上运行,我的 React 应用程序在端口 3000 上运行。我在 React 应用程序 package.json 中设置了一个代理来代理对端
我面临着一个愚蠢的问题。我试图在我的 Angular 应用程序中延迟加载我的图像,我已经尝试过这个2: 但是他们都设置了 src attr 而不是 data-src,我在这里遗漏了什么吗?保留 d
我是一名优秀的程序员,十分优秀!