function TCnMapFileChannel.CheckReady: Boolean;
begin
Result := (FMap <> 0) and (FMapHeader <> nil) and (FQueueEvent <> 0);
if not Result then
begin
FMap := OpenFileMapping(FILE_MAP_READ or FILE_MAP_WRITE, False, PChar(SCnDebugMapName));
if FMap <> 0 then
begin
FMapHeader := MapViewOfFile(FMap, FILE_MAP_READ or FILE_MAP_WRITE, 0, 0, 0);
if FMapHeader <> nil then
begin
FQueueEvent := OpenEvent(EVENT_MODIFY_STATE, False, PChar(SCnDebugQueueEventName));
if (FQueueEvent <> 0) then
begin
UpdateFlush;
Result := IsInitedFromHeader;
end;
end;
end;
end
else // 区域都有效
Result := PCnMapHeader(FMapHeader)^.MapEnabled = CnDebugMapEnabled;
if not Result then
DestroyHandles;
end;
在我的电脑上
Result := (FMap <> 0) and (FMapHeader <> nil) and (FQueueEvent <> 0);
Result 返回值是 False
而且后面的这条语句
FMap := OpenFileMapping(FILE_MAP_READ or FILE_MAP_WRITE, False, PChar(SCnDebugMapName));