mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 17:10:20 -10:00
Compare commits
30
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e659f8968d | ||
|
|
daba380372 | ||
|
|
efba67629a | ||
|
|
0b3deddb98 | ||
|
|
413a57758b | ||
|
|
922d8fa333 | ||
|
|
130c0468fc | ||
|
|
424e12a4d4 | ||
|
|
36399aae9d | ||
|
|
f29c7daae4 | ||
|
|
f8a2ea72d4 | ||
|
|
58f15b3bf0 | ||
|
|
6e04ed5ef2 | ||
|
|
04c3bba8aa | ||
|
|
4b79231f02 | ||
|
|
4ca325a98d | ||
|
|
1e80ae5c42 | ||
|
|
62575a1cf5 | ||
|
|
465057f629 | ||
|
|
0133b608dc | ||
|
|
f673245a98 | ||
|
|
830553f2ef | ||
|
|
b2999323d1 | ||
|
|
e46be16aa7 | ||
|
|
2a1aaf378c | ||
|
|
d15dcda71f | ||
|
|
56d4026ed0 | ||
|
|
476120edff | ||
|
|
8882ebfa9f | ||
|
|
6344e9a9b3 |
No files matched your search
@@ -1,3 +1,91 @@
|
||||
2007-08-20 Jonathan Pobst <[email protected]>
|
||||
[Backport of r84479]
|
||||
* StatusStrip.cs: Make sure the item's parent gets set in SetDisplayedItems.
|
||||
[Fixes bug #82481]
|
||||
|
||||
2007-08-14 Rolf Bjarne Kvinge <[email protected]>
|
||||
|
||||
* Control.cs: [Backport of r83588, fixes bug #82433] CreateControl: create
|
||||
implicit children as well. Fixes #82344. Don't create the child if it
|
||||
has been disposed already (may happen if the user closes the form the
|
||||
Load event).
|
||||
* MdiClient.cs: [Backport selected parts of r83065] Add a null-check.
|
||||
|
||||
2007-08-13 Rolf Bjarne Kvinge <[email protected]>
|
||||
|
||||
[Backport of r83935]
|
||||
|
||||
* PictureBox.cs: OnAnimateImage/UpdateAnimateImage: Check if handle is still
|
||||
created, it might have gotten destroyed since we last checked. Fixes
|
||||
#82405.
|
||||
|
||||
2007-08-13 Rolf Bjarne Kvinge <[email protected]>
|
||||
|
||||
[Backport selected parts of r83065. Fixes #82406]
|
||||
|
||||
* Control.cs: We need to reset the is_created flags when the handle is
|
||||
destroyed. Fixes #82187.
|
||||
* Form.cs: Don't raise OnLoad if the form has been disposed.
|
||||
|
||||
2007-08-10 Jonathan Pobst <[email protected]>
|
||||
[Backport of r83821]
|
||||
* ToolTip.cs: Hide the tooltip if the control is clicked to match MS behavior.
|
||||
[Fixes bug #82348]
|
||||
|
||||
2007-08-02 Rolf Bjarne Kvinge <[email protected]>
|
||||
|
||||
[ Backport selected parts of r82743, fixes #82234]
|
||||
|
||||
* DataGridViewRow.cs: SetValues: Don't blindly add cells to the row,
|
||||
the row may already have cells. SetDataGridView: set the DGV of all
|
||||
the contained cells as well.
|
||||
|
||||
2007-08-02 Rolf Bjarne Kvinge <[email protected]>
|
||||
|
||||
[ Backport of r83273]
|
||||
|
||||
* PropertyGrid.cs: PropertyGrid.cs: Add a null-check. Fixes
|
||||
#82289/SVGPad.
|
||||
|
||||
2007-08-02 Rolf Bjarne Kvinge <[email protected]>
|
||||
|
||||
[ Backport of r83268]
|
||||
|
||||
* ToolTip.cs: Use InitialDelay if ReshowDelay is zero. Fixes #82288.
|
||||
|
||||
2007-07-31 Carlos Alberto Cortez <[email protected]>
|
||||
[Backport to 1-2-5]
|
||||
* ListView.cs: Take into account the region used by header
|
||||
control when doing the vertical scroll (this way we invalidate
|
||||
the precise area, and don't get any dirty one).
|
||||
|
||||
2007-07-31 Carlos Alberto Cortez <[email protected]>
|
||||
[Backport to 1-2-5]
|
||||
* ListView.cs: Update some layout calculations in details view
|
||||
and clean the code in a pair of assignations.
|
||||
|
||||
2007-07-31 Carlos Alberto Cortez <[email protected]>
|
||||
[Backport to 1-2-5]
|
||||
* ListView.cs: When calculating layout, don't scrollbars before
|
||||
handle is created. This is unnecessary and also calculating them
|
||||
before handle creation time causes some random bugs.
|
||||
|
||||
2007-07-27 Everaldo Canuto <[email protected]>
|
||||
[Backport to 1-2-5]
|
||||
* FileDialog.cs: Check for valid filterIndex on button open/save.
|
||||
Fixes #82184.
|
||||
|
||||
2007-07-26 Rolf Bjarne Kvinge <[email protected]>
|
||||
[Backport to 1-2-5]
|
||||
* Form.cs: ShowDialog: don't destroy handles if the dialog is a common
|
||||
dialog. Fixes #82187.
|
||||
|
||||
2007-07-25 Jonathan Pobst <[email protected]>
|
||||
[Backport to 1-2-5]
|
||||
* UpDownBase.cs: We cannot override SetBoundsCore for 2.0, which was relayout-ing
|
||||
the children controls. Instead, we will just set up the proper docking for the
|
||||
children controls so we don't have to worry about it. [Fixes bug #82188]
|
||||
|
||||
2007-07-24 Jonathan Pobst <[email protected]>
|
||||
|
||||
* Menu.cs: Add some missing methods to MenuItemCollection.
|
||||
|
||||
@@ -3559,12 +3559,12 @@ namespace System.Windows.Forms
|
||||
if (!is_created) {
|
||||
is_created = true;
|
||||
|
||||
// Create all of our children when we are created.
|
||||
// Create all of our children (implicit ones as well) when we are created.
|
||||
// The child should fire it's OnLoad before the parents, however
|
||||
// if the child checks Parent.Created in it's OnCreateControl, the
|
||||
// parent is already created.
|
||||
foreach (Control c in Controls)
|
||||
if (!c.Created)
|
||||
foreach (Control c in Controls.GetAllControls ())
|
||||
if (!c.Created && !c.IsDisposed)
|
||||
c.CreateControl ();
|
||||
|
||||
#if ONLY_1_1
|
||||
@@ -5115,6 +5115,7 @@ namespace System.Windows.Forms
|
||||
#endif
|
||||
window.InvalidateHandle();
|
||||
|
||||
is_created = false;
|
||||
if (is_recreating) {
|
||||
#if DebugRecreate
|
||||
Console.WriteLine ("Creating handle for {0:X}", handle.ToInt32());
|
||||
|
||||
@@ -354,9 +354,14 @@ namespace System.Windows.Forms {
|
||||
}
|
||||
/////// COLUMNAS //////////
|
||||
for (int i = 0; i < values.Length; i++) {
|
||||
DataGridViewCell cell = new DataGridViewTextBoxCell();
|
||||
DataGridViewCell cell;
|
||||
if (cells.Count > i) {
|
||||
cell = cells [i];
|
||||
} else {
|
||||
cell = new DataGridViewTextBoxCell();
|
||||
cells.Add(cell);
|
||||
}
|
||||
cell.Value = values[i];
|
||||
cells.Add(cell);
|
||||
}
|
||||
|
||||
// XXX
|
||||
@@ -403,6 +408,8 @@ namespace System.Windows.Forms {
|
||||
{
|
||||
base.SetDataGridView(dataGridView);
|
||||
headerCell.SetDataGridView(dataGridView);
|
||||
foreach (DataGridViewCell cell in cells)
|
||||
cell.SetDataGridView (dataGridView);
|
||||
}
|
||||
|
||||
internal override void SetState (DataGridViewElementStates state)
|
||||
|
||||
@@ -921,6 +921,9 @@ namespace System.Windows.Forms
|
||||
string filter_exentsion = String.Empty;
|
||||
|
||||
if (fileFilter != null) {
|
||||
if (filterIndex > fileFilter.FilterArrayList.Count)
|
||||
filterIndex = fileTypeComboBox.SelectedIndex + 1;
|
||||
|
||||
FilterStruct filterstruct = (FilterStruct) fileFilter.FilterArrayList [filterIndex - 1];
|
||||
|
||||
for (int i = 0; i < filterstruct.filters.Count; i++) {
|
||||
|
||||
@@ -1707,9 +1707,13 @@ namespace System.Windows.Forms {
|
||||
// Cannot use Activate(), it has a check for the current active window...
|
||||
XplatUI.Activate(owner.window.Handle);
|
||||
}
|
||||
|
||||
|
||||
if (IsHandleCreated) {
|
||||
DestroyHandle ();
|
||||
// All CommonDialogs assume the form is still alive after a ShowDialog,
|
||||
// so don't destroy the handle in this case. Fix for #82187.
|
||||
if (!(this is CommonDialog.DialogForm)) {
|
||||
DestroyHandle ();
|
||||
}
|
||||
}
|
||||
|
||||
if (DialogResult == DialogResult.None) {
|
||||
@@ -2817,8 +2821,10 @@ namespace System.Windows.Forms {
|
||||
AutoScale = false;
|
||||
}
|
||||
|
||||
OnLoad (e);
|
||||
|
||||
if (!IsDisposed) {
|
||||
OnLoad (e);
|
||||
}
|
||||
|
||||
if (!IsMdiChild && !IsDisposed) {
|
||||
switch (StartPosition) {
|
||||
case FormStartPosition.CenterScreen:
|
||||
|
||||
@@ -1170,15 +1170,17 @@ namespace System.Windows.Forms
|
||||
|
||||
private void CalculateScrollBars ()
|
||||
{
|
||||
if (!IsHandleCreated)
|
||||
return;
|
||||
|
||||
Rectangle client_area = ClientRectangle;
|
||||
|
||||
if (!scrollable) {
|
||||
h_scroll.Visible = false;
|
||||
v_scroll.Visible = false;
|
||||
item_control.Location = new Point (0, header_control.Height);
|
||||
item_control.Height = ClientRectangle.Width - header_control.Height;
|
||||
item_control.Width = ClientRectangle.Width;
|
||||
header_control.Width = ClientRectangle.Width;
|
||||
item_control.Height = client_area.Height;
|
||||
item_control.Width = client_area.Width;
|
||||
header_control.Width = client_area.Width;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1205,7 +1207,7 @@ namespace System.Windows.Forms
|
||||
v_scroll.Visible = false;
|
||||
}
|
||||
|
||||
item_control.Height = ClientRectangle.Height - header_control.Height;
|
||||
item_control.Height = client_area.Height;
|
||||
|
||||
if (h_scroll.is_visible) {
|
||||
h_scroll.Location = new Point (client_area.X, client_area.Bottom - h_scroll.Height);
|
||||
@@ -1228,8 +1230,8 @@ namespace System.Windows.Forms
|
||||
}
|
||||
|
||||
if (header_control.is_visible)
|
||||
header_control.Width = ClientRectangle.Width;
|
||||
item_control.Width = ClientRectangle.Width;
|
||||
header_control.Width = client_area.Width;
|
||||
item_control.Width = client_area.Width;
|
||||
|
||||
if (v_scroll.is_visible) {
|
||||
v_scroll.Location = new Point (client_area.Right - v_scroll.Width, client_area.Y);
|
||||
@@ -1550,12 +1552,15 @@ namespace System.Windows.Forms
|
||||
x += col.Wd;
|
||||
}
|
||||
|
||||
layout_wd = x;
|
||||
|
||||
if (x < ClientRectangle.Width)
|
||||
x = ClientRectangle.Width;
|
||||
|
||||
if (header_style == ColumnHeaderStyle.None) {
|
||||
header_control.Visible = false;
|
||||
header_control.Size = Size.Empty;
|
||||
layout_wd = ClientRectangle.Width;
|
||||
} else {
|
||||
header_control.Width = x;
|
||||
header_control.Height = columns.Count > 0 ? columns [0].Ht : Font.Height + 5;
|
||||
@@ -1598,8 +1603,7 @@ namespace System.Windows.Forms
|
||||
y += 2;
|
||||
}
|
||||
|
||||
layout_wd = Math.Max (header_control.Width, item_control.Width);
|
||||
layout_ht = y + header_control.Height;
|
||||
layout_ht = y;
|
||||
}
|
||||
|
||||
private void AdjustItemsPositionArray (int count)
|
||||
@@ -2808,6 +2812,11 @@ namespace System.Windows.Forms
|
||||
if (v_marker != v_scroll.Value) {
|
||||
int pixels = v_marker - v_scroll.Value;
|
||||
Rectangle area = item_control.ClientRectangle;
|
||||
if (header_control.Visible) {
|
||||
area.Y += header_control.Height;
|
||||
area.Height -= header_control.Height;
|
||||
}
|
||||
|
||||
v_marker = v_scroll.Value;
|
||||
XplatUI.ScrollWindow (item_control.Handle, area, 0, pixels, false);
|
||||
}
|
||||
|
||||
@@ -894,7 +894,7 @@ namespace System.Windows.Forms {
|
||||
internal Form ActiveMdiChild {
|
||||
get {
|
||||
#if NET_2_0
|
||||
if (!ParentForm.Visible)
|
||||
if (ParentForm != null && !ParentForm.Visible)
|
||||
return null;
|
||||
#endif
|
||||
if (Controls.Count < 1)
|
||||
|
||||
@@ -413,11 +413,22 @@ namespace System.Windows.Forms {
|
||||
{
|
||||
// This is called from a worker thread,BeginInvoke is used
|
||||
// so the control is updated from the correct thread
|
||||
|
||||
// Check if we have a handle again, since it may have gotten
|
||||
// destroyed since the last time we checked.
|
||||
if (!IsHandleCreated)
|
||||
return;
|
||||
|
||||
BeginInvoke (new EventHandler (UpdateAnimatedImage), new object [] { this, e });
|
||||
}
|
||||
|
||||
private void UpdateAnimatedImage (object sender, EventArgs e)
|
||||
{
|
||||
// Check if we have a handle again, since it may have gotten
|
||||
// destroyed since the last time we checked.
|
||||
if (!IsHandleCreated)
|
||||
return;
|
||||
|
||||
ImageAnimator.UpdateFrames (image);
|
||||
Refresh ();
|
||||
}
|
||||
|
||||
@@ -1447,7 +1447,7 @@ namespace System.Windows.Forms {
|
||||
|
||||
PropertyDescriptor property = grid_entry.PropertyDescriptor;
|
||||
|
||||
if (property.Converter == null || !property.Converter.GetPropertiesSupported ())
|
||||
if (property == null || property.Converter == null || !property.Converter.GetPropertiesSupported ())
|
||||
return;
|
||||
|
||||
object [] objs = grid_entry.SelectedObjects;
|
||||
|
||||
@@ -247,12 +247,15 @@ namespace System.Windows.Forms
|
||||
{
|
||||
this.displayed_items.Clear ();
|
||||
|
||||
foreach (ToolStripItem tsi in this.Items)
|
||||
foreach (ToolStripItem tsi in this.Items) {
|
||||
tsi.Parent = this;
|
||||
|
||||
if (tsi.Placement == ToolStripItemPlacement.Main) {
|
||||
this.displayed_items.AddNoOwnerOrLayout (tsi);
|
||||
tsi.InternalVisible = true;
|
||||
} else
|
||||
tsi.InternalVisible = false;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void WndProc (ref Message m)
|
||||
|
||||
@@ -390,6 +390,7 @@ namespace System.Windows.Forms {
|
||||
control.MouseEnter += new EventHandler(control_MouseEnter);
|
||||
control.MouseMove += new MouseEventHandler(control_MouseMove);
|
||||
control.MouseLeave += new EventHandler(control_MouseLeave);
|
||||
control.MouseDown += new MouseEventHandler (control_MouseDown);
|
||||
controls.Add(control);
|
||||
}
|
||||
|
||||
@@ -486,7 +487,7 @@ namespace System.Windows.Forms {
|
||||
string text = (string)tooltip_strings[control];
|
||||
if (text != null && text.Length > 0) {
|
||||
|
||||
if (active_control == null) {
|
||||
if (active_control == null || re_show_delay == 0) {
|
||||
timer.Interval = initial_delay;
|
||||
} else {
|
||||
timer.Interval = re_show_delay;
|
||||
@@ -549,6 +550,18 @@ namespace System.Windows.Forms {
|
||||
Hide (sender as Control);
|
||||
}
|
||||
|
||||
|
||||
void control_MouseDown (object sender, MouseEventArgs e)
|
||||
{
|
||||
timer.Stop();
|
||||
|
||||
active_control = null;
|
||||
tooltip_window.Visible = false;
|
||||
|
||||
if (last_control == sender)
|
||||
last_control = null;
|
||||
}
|
||||
|
||||
private void Hide (Control sender)
|
||||
{
|
||||
timer.Stop();
|
||||
|
||||
@@ -316,9 +316,14 @@ namespace System.Windows.Forms
|
||||
txtView.Location = new System.Drawing.Point(17, 17);
|
||||
txtView.TabIndex = TabIndex;
|
||||
|
||||
spnSpinner.Width = 16;
|
||||
spnSpinner.Dock = DockStyle.Right;
|
||||
|
||||
txtView.Dock = DockStyle.Fill;
|
||||
|
||||
SuspendLayout ();
|
||||
Controls.Add (spnSpinner);
|
||||
Controls.Add (txtView);
|
||||
Controls.Add (spnSpinner);
|
||||
ResumeLayout ();
|
||||
|
||||
Height = PreferredHeight;
|
||||
@@ -332,8 +337,6 @@ namespace System.Windows.Forms
|
||||
txtView.Resize += new EventHandler(OnTextBoxResize);
|
||||
txtView.TextChanged += new EventHandler(OnTextBoxTextChanged);
|
||||
|
||||
txtView.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
|
||||
// So the child controls don't get auto selected when the updown is selected
|
||||
auto_select_child = false;
|
||||
SetStyle(ControlStyles.FixedHeight, true);
|
||||
@@ -346,27 +349,6 @@ namespace System.Windows.Forms
|
||||
#endregion
|
||||
|
||||
#region Private Methods
|
||||
void reseat_controls()
|
||||
{
|
||||
int text_displacement = 0;
|
||||
|
||||
int spinner_width = 16;
|
||||
//int spinner_width = ClientSize.Height;
|
||||
|
||||
if (_UpDownAlign == LeftRightAlignment.Left) {
|
||||
spnSpinner.Bounds = new Rectangle(0, 0, spinner_width, ClientSize.Height);
|
||||
text_displacement = spnSpinner.Width;
|
||||
|
||||
spnSpinner.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left;
|
||||
} else {
|
||||
spnSpinner.Bounds = new Rectangle(ClientSize.Width - spinner_width, 0, spinner_width, ClientSize.Height);
|
||||
|
||||
spnSpinner.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right;
|
||||
}
|
||||
|
||||
txtView.Bounds = new Rectangle(text_displacement, 0, ClientSize.Width - spinner_width, Height);
|
||||
}
|
||||
|
||||
private void TabIndexChangedHandler (object sender, EventArgs e)
|
||||
{
|
||||
txtView.TabIndex = TabIndex;
|
||||
@@ -599,9 +581,14 @@ namespace System.Windows.Forms
|
||||
return _UpDownAlign;
|
||||
}
|
||||
set {
|
||||
_UpDownAlign = value;
|
||||
|
||||
reseat_controls();
|
||||
if (_UpDownAlign != value) {
|
||||
_UpDownAlign = value;
|
||||
|
||||
if (value == LeftRightAlignment.Left)
|
||||
spnSpinner.Dock = DockStyle.Left;
|
||||
else
|
||||
spnSpinner.Dock = DockStyle.Right;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion // Public Instance Properties
|
||||
@@ -771,9 +758,6 @@ namespace System.Windows.Forms
|
||||
protected override void SetBoundsCore (int x, int y, int width, int height, BoundsSpecified specified)
|
||||
{
|
||||
base.SetBoundsCore(x, y, width, height, specified);
|
||||
|
||||
if ((specified & BoundsSpecified.Size) != BoundsSpecified.None)
|
||||
reseat_controls();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
2007-08-14 Rolf Bjarne Kvinge <[email protected]>
|
||||
|
||||
[Backport of r83650]
|
||||
|
||||
* UserControlTest.cs, PanelTest.cs, DefaultLayoutTest.cs,
|
||||
TableLayoutTest.cs, ControlTest.cs, ContainerControlTest.cs,
|
||||
FormTest.cs: Dispose of forms when they're no longer used.
|
||||
* ListViewCollectionsTest.cs: Dispose of listviews when they're no longer
|
||||
used.
|
||||
|
||||
2007-07-24 Rolf Bjarne Kvinge <[email protected]>
|
||||
|
||||
* DataGridViewColumnCollectionTest.cs,
|
||||
|
||||
@@ -269,6 +269,7 @@ namespace MonoTests.System.Windows.Forms {
|
||||
f.PublicProcessMnemonic ('b');
|
||||
|
||||
Assert.AreEqual (true, c.mnemonic_called, "A2");
|
||||
f.Dispose ();
|
||||
}
|
||||
|
||||
private class MyForm : Form
|
||||
|
||||
@@ -107,6 +107,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
c.AutoSize = true;
|
||||
f.PerformLayout();
|
||||
Assert.AreEqual (s, c.Size, "#S9");
|
||||
f.Close ();
|
||||
}
|
||||
|
||||
public class ControlAutoSizeTester : Control {
|
||||
@@ -2375,6 +2376,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
f.ResumeLayout ();
|
||||
|
||||
Assert.AreEqual (new Point (225, 287), button1.Location, "A3");
|
||||
f.Dispose ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -542,6 +542,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
f.Show ();
|
||||
|
||||
Assert.AreEqual (new Size (600, 600), c.lv.Size, "I1");
|
||||
f.Close ();
|
||||
}
|
||||
|
||||
private class MyUserControl : UserControl
|
||||
|
||||
@@ -1873,6 +1873,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
|
||||
f.AutoSize = false;
|
||||
Assert.AreEqual (start_size, f.ClientSize, "A2");
|
||||
f.Close ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -1895,6 +1896,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
f.Controls.Add (b);
|
||||
|
||||
Assert.AreEqual (new Size (203, 203), f.ClientSize, "A2");
|
||||
f.Dispose ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -404,6 +404,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.AreEqual (1, n, "SelectedIndexCollectionTest_AddTest#5");
|
||||
Assert.AreEqual (1, listview.SelectedIndices.Count, "SelectedIndexCollectionTest_AddTest#6");
|
||||
Assert.AreEqual (true, listview.Items [0].Selected, "SelectedIndexCollectionTest_AddTest#7");
|
||||
listview.Dispose ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -448,6 +449,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
n = listview.SelectedIndices.Add (0);
|
||||
Assert.AreEqual (3, n, "SelectedIndexCollectionTest_AddTest#17");
|
||||
Assert.AreEqual (3, listview.SelectedIndices.Count, "SelectedIndexCollectionTest_AddTest#18");
|
||||
listview.Dispose ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -478,6 +480,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.AreEqual (false, listview.Items [0].Selected, "SelectedIndexCollectionTest_ClearTest#6");
|
||||
Assert.AreEqual (false, listview.Items [1].Selected, "SelectedIndexCollectionTest_ClearTest#7");
|
||||
Assert.AreEqual (false, listview.Items [2].Selected, "SelectedIndexCollectionTest_ClearTest#8");
|
||||
listview.Dispose ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -507,6 +510,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.AreEqual (false, listview.Items [0].Selected, "SelectedIndexCollectionTest_ClearTest#6");
|
||||
Assert.AreEqual (false, listview.Items [1].Selected, "SelectedIndexCollectionTest_ClearTest#7");
|
||||
Assert.AreEqual (false, listview.Items [2].Selected, "SelectedIndexCollectionTest_ClearTest#8");
|
||||
listview.Dispose ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -536,6 +540,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.AreEqual (1, listview.SelectedIndices.IndexOf (item3.Index), "SelectedIndexCollectionTest_IndexOfTest#8");
|
||||
Assert.AreEqual (2, listview.SelectedIndices.IndexOf (item4.Index), "SelectedIndexCollectionTest_IndexOfTest#9");
|
||||
Assert.AreEqual (-1, listview.SelectedIndices.IndexOf (item2.Index), "SelectedIndexCollectionTest_IndexOfTest#10");
|
||||
listview.Dispose ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -561,6 +566,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.AreEqual (-1, listview.SelectedIndices.IndexOf (1), "SelectedIndexCollectionTest_IndexOfTest#5");
|
||||
Assert.AreEqual (-1, listview.SelectedIndices.IndexOf (99), "SelectedIndexCollectionTest_IndexOfTest#6");
|
||||
Assert.AreEqual (-1, listview.SelectedIndices.IndexOf (-1), "SelectedIndexCollectionTest_IndexOfTest#7");
|
||||
listview.Dispose ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -581,6 +587,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
listview.SelectedIndices.Remove (0);
|
||||
Assert.AreEqual (0, listview.SelectedIndices.Count, "SelectedIndexCollectionTest_RemoveTest#3");
|
||||
Assert.AreEqual (false, listview.Items [0].Selected, "SelectedIndexCollectionTest_RemoveTest#4");
|
||||
listview.Dispose ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -626,6 +633,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
listview.SelectedIndices.Remove (0);
|
||||
Assert.AreEqual (0, listview.SelectedIndices.Count, "SelectedIndexCollectionTest_RemoveTest#17");
|
||||
Assert.AreEqual (false, listview.Items [0].Selected, "SelectedIndexCollectionTest_RemoveTest#18");
|
||||
listview.Dispose ();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -961,6 +969,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
|
||||
Assert.AreEqual (4, lvw.SelectedItems.Count, "#B1");
|
||||
Assert.AreEqual (3, lvw.SelectedItems.IndexOfKey ("F name"), "#B2");
|
||||
lvw.Dispose ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -1002,6 +1011,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
|
||||
Assert.AreEqual (4, lvw.SelectedItems.Count, "#B1");
|
||||
Assert.AreEqual (lvi6, lvw.SelectedItems ["F name"], "#B2");
|
||||
lvw.Dispose ();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
|
||||
p.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
Assert.AreEqual (new Size (0, 0), p.ClientSize, "A3");
|
||||
f.Dispose ();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1037,6 +1037,8 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.AreEqual (new Rectangle (6, 101, 95, 96), _labelD.Bounds, "A40");
|
||||
Assert.AreEqual (new Rectangle (110, 101, 95, 96), _labelE.Bounds, "A41");
|
||||
Assert.AreEqual (new Rectangle (214, 101, 95, 96), _labelF.Bounds, "A42");
|
||||
|
||||
f.Close ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -109,6 +109,8 @@ namespace MonoTests.System.Windows.Forms
|
||||
|
||||
p.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
Assert.AreEqual (new Size (0, 0), p.ClientSize, "A3");
|
||||
|
||||
f.Close ();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2007-08-16 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* RecordProtocol.cs, SslStreamBase.cs: Ensure nothing (even the same
|
||||
thread) can confuse the record decoding code. Fix bug #82145 (LDAP)
|
||||
which uses several thread over a single SslClientStream instance.
|
||||
|
||||
2007-05-23 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* Context.cs: fix the calculation of the unix time.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Transport Security Layer (TLS)
|
||||
// Copyright (c) 2003-2004 Carlos Guzman Alvarez
|
||||
// Copyright (C) 2006 Novell, Inc (http://www.novell.com)
|
||||
// Copyright (C) 2006-2007 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
@@ -35,6 +35,8 @@ namespace Mono.Security.Protocol.Tls
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private static ManualResetEvent record_processing = new ManualResetEvent (true);
|
||||
|
||||
protected Stream innerStream;
|
||||
protected Context context;
|
||||
|
||||
@@ -316,6 +318,7 @@ namespace Mono.Security.Protocol.Tls
|
||||
"The session is finished and it's no longer valid.");
|
||||
}
|
||||
|
||||
record_processing.Reset ();
|
||||
byte[] recordTypeBuffer = new byte[1];
|
||||
|
||||
ReceiveRecordAsyncResult internalResult = new ReceiveRecordAsyncResult(callback, state, recordTypeBuffer, record);
|
||||
@@ -426,8 +429,10 @@ namespace Mono.Security.Protocol.Tls
|
||||
|
||||
if (internalResult.CompletedWithError)
|
||||
throw internalResult.AsyncException;
|
||||
else
|
||||
return internalResult.ResultingBuffer;
|
||||
|
||||
byte[] result = internalResult.ResultingBuffer;
|
||||
record_processing.Set ();
|
||||
return result;
|
||||
}
|
||||
|
||||
public byte[] ReceiveRecord(Stream record)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Transport Security Layer (TLS)
|
||||
// Copyright (c) 2003-2004 Carlos Guzman Alvarez
|
||||
// Copyright (C) 2006 Novell, Inc (http://www.novell.com)
|
||||
// Copyright (C) 2006-2007 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
@@ -39,6 +39,8 @@ namespace Mono.Security.Protocol.Tls
|
||||
|
||||
#region Fields
|
||||
|
||||
static ManualResetEvent record_processing = new ManualResetEvent (true);
|
||||
|
||||
private const int WaitTimeOut = 5 * 60 * 1000;
|
||||
|
||||
internal Stream innerStream;
|
||||
@@ -950,6 +952,7 @@ namespace Mono.Security.Protocol.Tls
|
||||
|
||||
lock (this.read) {
|
||||
try {
|
||||
record_processing.Reset ();
|
||||
// do we already have some decrypted data ?
|
||||
if (this.inputBuffer.Position > 0) {
|
||||
// or maybe we used all the buffer before ?
|
||||
@@ -957,8 +960,10 @@ namespace Mono.Security.Protocol.Tls
|
||||
this.inputBuffer.SetLength (0);
|
||||
} else {
|
||||
int n = this.inputBuffer.Read (buffer, offset, count);
|
||||
if (n > 0)
|
||||
if (n > 0) {
|
||||
record_processing.Set ();
|
||||
return n;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -969,7 +974,16 @@ namespace Mono.Security.Protocol.Tls
|
||||
needMoreData = false;
|
||||
// if we loop, then it either means we need more data
|
||||
byte[] recbuf = new byte[16384];
|
||||
int n = innerStream.Read (recbuf, 0, recbuf.Length);
|
||||
int n = 0;
|
||||
if (count == 1) {
|
||||
int value = innerStream.ReadByte ();
|
||||
if (value >= 0) {
|
||||
recbuf[0] = (byte) value;
|
||||
n = 1;
|
||||
}
|
||||
} else {
|
||||
n = innerStream.Read (recbuf, 0, recbuf.Length);
|
||||
}
|
||||
if (n > 0) {
|
||||
// Add the new received data to the waiting data
|
||||
if ((recordStream.Length > 0) && (recordStream.Position != recordStream.Length))
|
||||
@@ -977,6 +991,7 @@ namespace Mono.Security.Protocol.Tls
|
||||
recordStream.Write (recbuf, 0, n);
|
||||
} else {
|
||||
// or that the read operation is done (lost connection in the case of a network stream).
|
||||
record_processing.Set ();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -1025,7 +1040,9 @@ namespace Mono.Security.Protocol.Tls
|
||||
if (dataToReturn) {
|
||||
// we have record(s) to return -or- no more available to read from network
|
||||
// reset position for further reading
|
||||
return this.inputBuffer.Read (buffer, offset, count);
|
||||
int i = inputBuffer.Read (buffer, offset, count);
|
||||
record_processing.Set ();
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2007-08-10 Gert Driesen <[email protected]>
|
||||
|
||||
* PagesConfigurationHandler.cs: Use enum for EnableSessionState.
|
||||
* PagesConfiguration.cs: Use enum for EnableSessionState.
|
||||
|
||||
2007-05-01 Marek Habersack <[email protected]>
|
||||
|
||||
* HttpCapabilitiesBase.cs: move the User-Agent code to a separate
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace System.Web.Configuration
|
||||
class PagesConfiguration
|
||||
{
|
||||
internal bool Buffer = true;
|
||||
internal string EnableSessionState = "true";
|
||||
internal PagesEnableSessionState EnableSessionState = PagesEnableSessionState.True;
|
||||
internal bool EnableViewState = true;
|
||||
internal bool EnableViewStateMac = false;
|
||||
internal bool SmartNavigation = false;
|
||||
|
||||
@@ -48,11 +48,22 @@ namespace System.Web.Configuration
|
||||
|
||||
attvalue = AttValue ("enableSessionState", section);
|
||||
if (attvalue != null) {
|
||||
if (attvalue != "true" && attvalue != "false" && attvalue != "ReadOnly")
|
||||
switch (attvalue) {
|
||||
case "true":
|
||||
config.EnableSessionState = PagesEnableSessionState.True;
|
||||
break;
|
||||
case "ReadOnly":
|
||||
config.EnableSessionState = PagesEnableSessionState.ReadOnly;
|
||||
break;
|
||||
case "false":
|
||||
config.EnableSessionState = PagesEnableSessionState.False;
|
||||
break;
|
||||
default:
|
||||
HandlersUtil.ThrowException ("The 'enableSessionState' attribute"
|
||||
+ " is case sensitive and must be one of the following values:"
|
||||
+ " false, true, ReadOnly.", section);
|
||||
config.EnableSessionState = attvalue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
attvalue = AttValue ("enableViewState", section);
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
2007-08-10 Gert Driesen <[email protected]>
|
||||
|
||||
* PagesEnableSessionState.cs: Marked internal on 1.0 profile.
|
||||
|
||||
2007-07-16 Vladimir Krasnov <[email protected]>
|
||||
|
||||
* ProfileGroupSettingsCollection.cs: added ResetInternal internal
|
||||
|
||||
@@ -28,14 +28,17 @@
|
||||
|
||||
using System.Resources;
|
||||
|
||||
#if NET_2_0
|
||||
namespace System.Web.Configuration
|
||||
{
|
||||
public enum PagesEnableSessionState
|
||||
{
|
||||
False = 0,
|
||||
ReadOnly = 1,
|
||||
True = 2
|
||||
}
|
||||
}
|
||||
#if NET_2_0
|
||||
public
|
||||
#else
|
||||
internal
|
||||
#endif
|
||||
enum PagesEnableSessionState
|
||||
{
|
||||
False = 0,
|
||||
ReadOnly = 1,
|
||||
True = 2
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,10 @@
|
||||
2007-07-31 Marek Habersack <[email protected]>
|
||||
|
||||
* SessionInProcHandler.cs: initialize the static session objects
|
||||
collection from the application state instead of using
|
||||
SessionStateUtility.GetSessionStaticObjects. Fixes bug #82193
|
||||
* SessionStateServerHandler.cs: as above
|
||||
|
||||
2007-06-20 Marek Habersack <[email protected]>
|
||||
|
||||
* SessionInProcHandler.cs: use HttpRuntime.InternalCache to keep
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace System.Web.SessionState
|
||||
public override SessionStateStoreData CreateNewStoreData (HttpContext context, int timeout)
|
||||
{
|
||||
return new SessionStateStoreData (new SessionStateItemCollection (),
|
||||
SessionStateUtility.GetSessionStaticObjects(context),
|
||||
HttpApplicationFactory.ApplicationState.SessionObjects,
|
||||
timeout);
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ namespace System.Web.SessionState
|
||||
item.items = new SessionStateItemCollection ();
|
||||
}
|
||||
return new SessionStateStoreData (item.items,
|
||||
SessionStateUtility.GetSessionStaticObjects(context),
|
||||
HttpApplicationFactory.ApplicationState.SessionObjects,
|
||||
item.timeout);
|
||||
} catch {
|
||||
// we want such errors to be passed to the application.
|
||||
@@ -344,7 +344,7 @@ namespace System.Web.SessionState
|
||||
expireCallback (key,
|
||||
new SessionStateStoreData (
|
||||
item.items,
|
||||
SessionStateUtility.GetSessionStaticObjects (HttpContext.Current),
|
||||
HttpApplicationFactory.ApplicationState.SessionObjects,
|
||||
item.timeout));
|
||||
} else
|
||||
expireCallback (key, null);
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace System.Web.SessionState
|
||||
public override SessionStateStoreData CreateNewStoreData (HttpContext context, int timeout)
|
||||
{
|
||||
return new SessionStateStoreData (new SessionStateItemCollection (),
|
||||
SessionStateUtility.GetSessionStaticObjects(context),
|
||||
HttpApplicationFactory.ApplicationState.SessionObjects,
|
||||
timeout);
|
||||
}
|
||||
|
||||
@@ -73,9 +73,11 @@ namespace System.Web.SessionState
|
||||
out SessionStateActions actions,
|
||||
bool exclusive)
|
||||
{
|
||||
#if TRACE
|
||||
Console.WriteLine ("SessionStateServerHandler.GetItemInternal");
|
||||
Console.WriteLine ("\tid == {0}", id);
|
||||
Console.WriteLine ("\tpath == {0}", context.Request.FilePath);
|
||||
#endif
|
||||
locked = false;
|
||||
lockAge = TimeSpan.MinValue;
|
||||
lockId = Int32.MinValue;
|
||||
@@ -92,11 +94,15 @@ namespace System.Web.SessionState
|
||||
exclusive);
|
||||
|
||||
if (item == null) {
|
||||
#if TRACE
|
||||
Console.WriteLine ("\titem is null (locked == {0}, actions == {1})", locked, actions);
|
||||
#endif
|
||||
return null;
|
||||
}
|
||||
if (actions == SessionStateActions.InitializeItem) {
|
||||
#if TRACE
|
||||
Console.WriteLine ("\titem needs initialization");
|
||||
#endif
|
||||
return CreateNewStoreData (context, item.Timeout);
|
||||
}
|
||||
SessionStateItemCollection items = null;
|
||||
@@ -150,7 +156,9 @@ namespace System.Web.SessionState
|
||||
|
||||
public override void Initialize (string name, NameValueCollection config)
|
||||
{
|
||||
#if TRACE
|
||||
Console.WriteLine ("SessionStateServerHandler.Initialize");
|
||||
#endif
|
||||
if (String.IsNullOrEmpty (name))
|
||||
name = "Session Server handler";
|
||||
privateConfig = config;
|
||||
|
||||
@@ -1,7 +1,21 @@
|
||||
2007-08-10 Gert Driesen <[email protected]>
|
||||
|
||||
* PageParser.cs: Replace enableSessionState and readOnlySessionState
|
||||
bools with enum backed field. Move 1.0 profile code for checking value
|
||||
of EnableSessionState pages config to PagesConfigurationHandler.
|
||||
Fixes bug #82392 for 1.0 profile.
|
||||
|
||||
2007-08-09 Marek Habersack <[email protected]>
|
||||
|
||||
* PageParser.cs: honor web.config enableSessionState
|
||||
ReadOnly setting instead of overwriting based on default value for
|
||||
page directive EnableSessionState. Patch from Joel Reed
|
||||
<[email protected]>, thanks! Fixes bug #82392
|
||||
|
||||
2007-07-24 Igor Zelmanovich <[email protected]>
|
||||
|
||||
* ClientScriptManager.cs: fixed: GetCallbackEventReference method.
|
||||
|
||||
|
||||
2007-07-23 Igor Zelmanovich <[email protected]>
|
||||
|
||||
* Page.cs: refactoring: __doPostBack client script
|
||||
|
||||
@@ -43,14 +43,13 @@ namespace System.Web.UI
|
||||
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
|
||||
public sealed class PageParser : TemplateControlParser
|
||||
{
|
||||
bool enableSessionState = true;
|
||||
PagesEnableSessionState enableSessionState = PagesEnableSessionState.True;
|
||||
bool enableViewStateMac = true;
|
||||
bool smartNavigation = false;
|
||||
bool smartNavigation;
|
||||
bool haveTrace;
|
||||
bool trace;
|
||||
bool notBuffer;
|
||||
TraceMode tracemode;
|
||||
bool readonlySessionState;
|
||||
string responseEncoding;
|
||||
string contentType;
|
||||
int codepage = -1;
|
||||
@@ -112,24 +111,7 @@ namespace System.Web.UI
|
||||
#endif
|
||||
|
||||
notBuffer = !ps.Buffer;
|
||||
#if NET_2_0
|
||||
switch (ps.EnableSessionState) {
|
||||
case PagesEnableSessionState.True:
|
||||
case PagesEnableSessionState.ReadOnly:
|
||||
enableSessionState = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
enableSessionState = false;
|
||||
break;
|
||||
}
|
||||
#else
|
||||
if (String.Compare (ps.EnableSessionState, "true", true, CultureInfo.InvariantCulture) == 0)
|
||||
enableSessionState = true;
|
||||
else
|
||||
enableSessionState = false;
|
||||
#endif
|
||||
|
||||
enableSessionState = ps.EnableSessionState;
|
||||
enableViewStateMac = ps.EnableViewStateMac;
|
||||
smartNavigation = ps.SmartNavigation;
|
||||
validateRequest = ps.ValidateRequest;
|
||||
@@ -165,23 +147,23 @@ namespace System.Web.UI
|
||||
// note: the 'enableSessionState' configuration property is
|
||||
// processed in a case-sensitive manner while the page-level
|
||||
// attribute is processed case-insensitive
|
||||
string enabless = GetString (atts, "EnableSessionState", enableSessionState.ToString ());
|
||||
string enabless = GetString (atts, "EnableSessionState", null);
|
||||
if (enabless != null) {
|
||||
readonlySessionState = (String.Compare (enabless, "readonly", true) == 0);
|
||||
if (readonlySessionState == true || String.Compare (enabless, "true", true) == 0) {
|
||||
enableSessionState = true;
|
||||
} else if (String.Compare (enabless, "false", true) == 0) {
|
||||
enableSessionState = false;
|
||||
} else {
|
||||
if (String.Compare (enabless, "readonly", true) == 0)
|
||||
enableSessionState = PagesEnableSessionState.ReadOnly;
|
||||
else if (String.Compare (enabless, "true", true) == 0)
|
||||
enableSessionState = PagesEnableSessionState.True;
|
||||
else if (String.Compare (enabless, "false", true) == 0)
|
||||
enableSessionState = PagesEnableSessionState.False;
|
||||
else
|
||||
ThrowParseException ("Invalid value for enableSessionState: " + enabless);
|
||||
}
|
||||
}
|
||||
|
||||
string cp = GetString (atts, "CodePage", null);
|
||||
if (cp != null) {
|
||||
if (responseEncoding != null)
|
||||
ThrowParseException ("CodePage and ResponseEncoding are " +
|
||||
"mutually exclusive.");
|
||||
"mutually exclusive.");
|
||||
|
||||
int codepage = 0;
|
||||
try {
|
||||
@@ -436,7 +418,10 @@ namespace System.Web.UI
|
||||
}
|
||||
|
||||
internal bool EnableSessionState {
|
||||
get { return enableSessionState; }
|
||||
get {
|
||||
return enableSessionState == PagesEnableSessionState.True ||
|
||||
ReadOnlySessionState;
|
||||
}
|
||||
}
|
||||
|
||||
internal bool EnableViewStateMac {
|
||||
@@ -448,7 +433,9 @@ namespace System.Web.UI
|
||||
}
|
||||
|
||||
internal bool ReadOnlySessionState {
|
||||
get { return readonlySessionState; }
|
||||
get {
|
||||
return enableSessionState == PagesEnableSessionState.ReadOnly;
|
||||
}
|
||||
}
|
||||
|
||||
internal bool HaveTrace {
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace System.Collections.Specialized
|
||||
|
||||
protected virtual void OnDeserialization (object sender)
|
||||
{
|
||||
OnDeserialization (sender);
|
||||
((IDeserializationCallback) this).OnDeserialization (sender);
|
||||
}
|
||||
|
||||
void IDeserializationCallback.OnDeserialization (object sender)
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2007-07-26 Jonathan Chambers <[email protected]>
|
||||
|
||||
* ComInteropProxy.cs: Call Marshal.Release after Marshal.QI
|
||||
since it AddRef's the object. Fixes COM leak. Also fix eol-style.
|
||||
|
||||
2007-05-25 Jonathan Chambers <[email protected]>
|
||||
|
||||
* ComInteropProxy.cs: Call __ComObject.GetInterface overload
|
||||
|
||||
@@ -42,16 +42,16 @@ namespace Mono.Interop
|
||||
{
|
||||
internal class ComInteropProxy : RealProxy, IRemotingTypeInfo
|
||||
{
|
||||
#region Sync with object-internals.h
|
||||
private __ComObject com_object;
|
||||
#region Sync with object-internals.h
|
||||
private __ComObject com_object;
|
||||
int ref_count = 1; // wrapper ref count
|
||||
#endregion
|
||||
private string type_name;
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
private extern static void AddProxy (IntPtr pItf, ComInteropProxy proxy);
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
private string type_name;
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
private extern static void AddProxy (IntPtr pItf, ComInteropProxy proxy);
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
internal extern static ComInteropProxy FindProxy (IntPtr pItf);
|
||||
|
||||
public ComInteropProxy (Type t)
|
||||
@@ -65,7 +65,7 @@ namespace Mono.Interop
|
||||
internal void CacheProxy ()
|
||||
{
|
||||
// called from unmanaged code after .ctor is invoked
|
||||
// we need .ctor to create unmanaged object and thus IUnknown property value
|
||||
// we need .ctor to create unmanaged object and thus IUnknown property value
|
||||
AddProxy (com_object.IUnknown, this);
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace Mono.Interop
|
||||
internal ComInteropProxy (IntPtr pUnk, Type t)
|
||||
: base (t)
|
||||
{
|
||||
com_object = new __ComObject (pUnk);
|
||||
com_object = new __ComObject (pUnk);
|
||||
CacheProxy ();
|
||||
}
|
||||
|
||||
@@ -86,13 +86,15 @@ namespace Mono.Interop
|
||||
IntPtr ppv;
|
||||
Guid iid = __ComObject.IID_IUnknown;
|
||||
int hr = Marshal.QueryInterface (pItf, ref iid, out ppv);
|
||||
Marshal.ThrowExceptionForHR (hr);
|
||||
Marshal.ThrowExceptionForHR (hr);
|
||||
ComInteropProxy obj = FindProxy (ppv);
|
||||
if (obj == null) {
|
||||
Marshal.Release (pItf);
|
||||
return new ComInteropProxy (ppv);
|
||||
}
|
||||
else {
|
||||
System.Threading.Interlocked.Increment (ref obj.ref_count);
|
||||
else {
|
||||
Marshal.Release (pItf);
|
||||
System.Threading.Interlocked.Increment (ref obj.ref_count);
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2007-07-30 Lluis Sanchez Gual <[email protected]>
|
||||
|
||||
* MethodCall.cs (ResolveMethod): If the method is implemented
|
||||
in an interface, look for the method implementation. Fix for bxc #82240
|
||||
|
||||
2007-02-05 Robert Jordan <[email protected]>
|
||||
|
||||
* MethodCall.cs (ResolveMethod): Actually use the type returned
|
||||
|
||||
@@ -317,8 +317,17 @@ namespace System.Runtime.Remoting.Messaging {
|
||||
Type requestType = CastTo (_typeName, type);
|
||||
|
||||
if (requestType != null) {
|
||||
// Look for the method in the requested type. The method signature is provided
|
||||
// only if the method is overloaded in the requested type.
|
||||
_methodBase = RemotingServices.GetMethodBaseFromName (requestType, _methodName, _methodSignature);
|
||||
if (_methodBase == null) throw new RemotingException ("Method " + _methodName + " not found in " + type);
|
||||
if (_methodBase == null)
|
||||
throw new RemotingException ("Method " + _methodName + " not found in " + type);
|
||||
|
||||
// If the method is implemented in an interface, look for the method implementation.
|
||||
// It can't be done in the previous GetMethodBaseFromName call because at that point we
|
||||
// may not yet have the method signature.
|
||||
if (requestType != type && requestType.IsInterface)
|
||||
_methodBase = RemotingServices.GetMethodBaseFromName (type, _methodName, (Type[]) MethodSignature);
|
||||
}
|
||||
else
|
||||
throw new RemotingException ("Cannot cast from client type '" + _typeName + "' to server type '" + type.FullName + "'");
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
2007-08-17 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* CryptoStream.cs: Write cannot depend on buffer.Length (fix #82428)
|
||||
|
||||
2007-05-16 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* CryptoStream.cs: Fix another problem that can occurs with WriteByte.
|
||||
|
||||
@@ -261,6 +261,8 @@ namespace System.Security.Cryptography {
|
||||
if (_stream == null)
|
||||
throw new ArgumentNullException ("inner stream was diposed");
|
||||
|
||||
int buffer_length = count;
|
||||
|
||||
// partial block (in progress)
|
||||
if ((_partialCount > 0) && (_partialCount != _transform.InputBlockSize)) {
|
||||
int remainder = _transform.InputBlockSize - _partialCount;
|
||||
@@ -297,7 +299,7 @@ namespace System.Security.Cryptography {
|
||||
}
|
||||
|
||||
if (rem > 0)
|
||||
Buffer.BlockCopy (buffer, buffer.Length - rem, _workingBlock, 0, rem);
|
||||
Buffer.BlockCopy (buffer, buffer_length - rem, _workingBlock, 0, rem);
|
||||
_partialCount = rem;
|
||||
count = 0; // the last block, if any, is in _workingBlock
|
||||
} else {
|
||||
|
||||
@@ -1,3 +1,28 @@
|
||||
2007-08-23 Robert Jordan <[email protected]>
|
||||
|
||||
* marshal.c (Marshal_ReAllocHGlobal) : Fix GlobalReAlloc's flags.
|
||||
Fixes #82499.
|
||||
|
||||
2007-07-03 Jonathan Chambers <[email protected]>
|
||||
|
||||
* marshal.c: Implement COM Objects as return type for
|
||||
managed->unmanaged calls. Added Release calls for COM Object
|
||||
out/return values in managed->unmanaged calls.
|
||||
|
||||
Code is contributed under MIT/X11 license.
|
||||
|
||||
2007-07-31 William Holmes <[email protected]>
|
||||
|
||||
* metadata.c Changed mono_type_create_from_typespec to not insert
|
||||
the type into the has map until after
|
||||
do_mono_metadata_parse_type has completed.
|
||||
Fixes Bug #82194
|
||||
Code is contributed under MIT/X11 license.
|
||||
|
||||
Wed Jul 25 18:06:33 CEST 2007 Paolo Molaro <[email protected]>
|
||||
|
||||
* object.c: properly setup interface_bitmap in proxy vtables.
|
||||
|
||||
2007-07-24 Rodrigo Kumpera <[email protected]>
|
||||
|
||||
* class.c (mono_bounded_array_class_get): fixed memory leak when
|
||||
|
||||
+54
-4
@@ -7053,6 +7053,7 @@ emit_marshal_com_interface (EmitMarshalContext *m, int argnum, MonoType *t,
|
||||
static MonoMethod* get_iunknown_for_object_internal = NULL;
|
||||
static MonoMethod* get_com_interface_for_object_internal = NULL;
|
||||
static MonoMethod* get_idispatch_for_object_internal = NULL;
|
||||
static MonoMethod* marshal_release = NULL;
|
||||
if (!get_object_for_iunknown)
|
||||
get_object_for_iunknown = mono_class_get_method_from_name (mono_defaults.marshal_class, "GetObjectForIUnknown", 1);
|
||||
if (!get_iunknown_for_object_internal)
|
||||
@@ -7061,6 +7062,8 @@ emit_marshal_com_interface (EmitMarshalContext *m, int argnum, MonoType *t,
|
||||
get_idispatch_for_object_internal = mono_class_get_method_from_name (mono_defaults.marshal_class, "GetIDispatchForObjectInternal", 1);
|
||||
if (!get_com_interface_for_object_internal)
|
||||
get_com_interface_for_object_internal = mono_class_get_method_from_name (mono_defaults.marshal_class, "GetComInterfaceForObjectInternal", 2);
|
||||
if (!marshal_release)
|
||||
marshal_release = mono_class_get_method_from_name (mono_defaults.marshal_class, "Release", 1);
|
||||
|
||||
/* COM types are initialized lazily */
|
||||
mono_init_com_types ();
|
||||
@@ -7134,6 +7137,7 @@ emit_marshal_com_interface (EmitMarshalContext *m, int argnum, MonoType *t,
|
||||
if (klass && klass != mono_defaults.object_class)
|
||||
mono_mb_emit_op (mb, CEE_CASTCLASS, klass);
|
||||
mono_mb_emit_byte (mb, CEE_STIND_REF);
|
||||
|
||||
pos_end = mono_mb_emit_short_branch (mb, CEE_BR_S);
|
||||
|
||||
/* is already managed object */
|
||||
@@ -7145,8 +7149,13 @@ emit_marshal_com_interface (EmitMarshalContext *m, int argnum, MonoType *t,
|
||||
mono_mb_emit_op (mb, CEE_CASTCLASS, klass);
|
||||
mono_mb_emit_byte (mb, CEE_STIND_REF);
|
||||
|
||||
|
||||
mono_mb_patch_short_branch (mb, pos_end);
|
||||
|
||||
/* need to call Release to follow COM rules of ownership */
|
||||
mono_mb_emit_ldloc (mb, conv_arg);
|
||||
mono_mb_emit_managed_call (mb, marshal_release, NULL);
|
||||
mono_mb_emit_byte (mb, CEE_POP);
|
||||
|
||||
/* case if null */
|
||||
mono_mb_patch_short_branch (mb, pos_null);
|
||||
}
|
||||
@@ -7160,8 +7169,49 @@ emit_marshal_com_interface (EmitMarshalContext *m, int argnum, MonoType *t,
|
||||
break;
|
||||
|
||||
case MARSHAL_ACTION_CONV_RESULT: {
|
||||
char *msg = g_strdup ("Marshalling of COM Objects is not yet implemented.");
|
||||
mono_mb_emit_exception_marshal_directive (mb, msg);
|
||||
int ccw_obj;
|
||||
guint32 pos_null = 0, pos_ccw = 0, pos_end = 0;
|
||||
ccw_obj = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg);
|
||||
|
||||
/* store return value */
|
||||
mono_mb_emit_stloc (mb, 0);
|
||||
|
||||
mono_mb_emit_ldloc (mb, 0);
|
||||
pos_null = mono_mb_emit_short_branch (mb, CEE_BRFALSE_S);
|
||||
|
||||
mono_mb_emit_ldloc (mb, 0);
|
||||
mono_mb_emit_icon (mb, TRUE);
|
||||
mono_mb_emit_icall (mb, cominterop_get_ccw_object);
|
||||
mono_mb_emit_stloc (mb, ccw_obj);
|
||||
mono_mb_emit_ldloc (mb, ccw_obj);
|
||||
pos_ccw = mono_mb_emit_short_branch (mb, CEE_BRTRUE_S);
|
||||
|
||||
mono_mb_emit_ldloc (mb, 0);
|
||||
mono_mb_emit_managed_call (mb, get_object_for_iunknown, NULL);
|
||||
|
||||
if (klass && klass != mono_defaults.object_class)
|
||||
mono_mb_emit_op (mb, CEE_CASTCLASS, klass);
|
||||
mono_mb_emit_stloc (mb, 3);
|
||||
|
||||
pos_end = mono_mb_emit_short_branch (mb, CEE_BR_S);
|
||||
|
||||
/* is already managed object */
|
||||
mono_mb_patch_short_branch (mb, pos_ccw);
|
||||
mono_mb_emit_ldloc (mb, ccw_obj);
|
||||
|
||||
if (klass && klass != mono_defaults.object_class)
|
||||
mono_mb_emit_op (mb, CEE_CASTCLASS, klass);
|
||||
mono_mb_emit_stloc (mb, 3);
|
||||
|
||||
mono_mb_patch_short_branch (mb, pos_end);
|
||||
|
||||
/* need to call Release to follow COM rules of ownership */
|
||||
mono_mb_emit_ldloc (mb, 0);
|
||||
mono_mb_emit_managed_call (mb, marshal_release, NULL);
|
||||
mono_mb_emit_byte (mb, CEE_POP);
|
||||
|
||||
/* case if null */
|
||||
mono_mb_patch_short_branch (mb, pos_null);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -10623,7 +10673,7 @@ ves_icall_System_Runtime_InteropServices_Marshal_ReAllocHGlobal (gpointer ptr, i
|
||||
}
|
||||
|
||||
#ifdef PLATFORM_WIN32
|
||||
res = GlobalReAlloc (ptr, (gulong)size, 0);
|
||||
res = GlobalReAlloc (ptr, (gulong)size, GMEM_MOVEABLE);
|
||||
#else
|
||||
res = g_try_realloc (ptr, (gulong)size);
|
||||
#endif
|
||||
|
||||
@@ -4146,7 +4146,7 @@ mono_type_create_from_typespec (MonoImage *image, guint32 type_spec)
|
||||
guint32 cols [MONO_TYPESPEC_SIZE];
|
||||
const char *ptr;
|
||||
guint32 len;
|
||||
MonoType *type;
|
||||
MonoType *type, *type2;
|
||||
|
||||
mono_loader_lock ();
|
||||
|
||||
@@ -4164,20 +4164,27 @@ mono_type_create_from_typespec (MonoImage *image, guint32 type_spec)
|
||||
|
||||
type = g_new0 (MonoType, 1);
|
||||
|
||||
g_hash_table_insert (image->typespec_cache, GUINT_TO_POINTER (type_spec), type);
|
||||
|
||||
if (*ptr == MONO_TYPE_BYREF) {
|
||||
type->byref = 1;
|
||||
ptr++;
|
||||
}
|
||||
|
||||
if (!do_mono_metadata_parse_type (type, image, NULL, ptr, &ptr)) {
|
||||
g_hash_table_remove (image->typespec_cache, GUINT_TO_POINTER (type_spec));
|
||||
g_free (type);
|
||||
mono_loader_unlock ();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
type2 = g_hash_table_lookup (image->typespec_cache, GUINT_TO_POINTER (type_spec));
|
||||
|
||||
if (type2) {
|
||||
g_free (type);
|
||||
mono_loader_unlock ();
|
||||
return type2;
|
||||
}
|
||||
|
||||
g_hash_table_insert (image->typespec_cache, GUINT_TO_POINTER (type_spec), type);
|
||||
|
||||
mono_loader_unlock ();
|
||||
|
||||
return type;
|
||||
|
||||
@@ -1575,7 +1575,7 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mono
|
||||
}
|
||||
|
||||
pvt->max_interface_id = max_interface_id;
|
||||
pvt->interface_bitmap = class->interface_bitmap;
|
||||
pvt->interface_bitmap = mono_mempool_alloc0 (domain->mp, sizeof (guint8) * (max_interface_id/8 + 1 ));
|
||||
|
||||
if (! ARCH_USE_IMT) {
|
||||
/* initialize interface offsets */
|
||||
@@ -1585,6 +1585,10 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mono
|
||||
interface_offsets [class->max_interface_id - interface_id] = &(pvt->vtable [slot]);
|
||||
}
|
||||
}
|
||||
for (i = 0; i < class->interface_offsets_count; ++i) {
|
||||
int interface_id = class->interfaces_packed [i]->interface_id;
|
||||
pvt->interface_bitmap [interface_id >> 3] |= (1 << (interface_id & 7));
|
||||
}
|
||||
|
||||
if (extra_interfaces) {
|
||||
int slot = class->vtable_size;
|
||||
@@ -1600,6 +1604,7 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mono
|
||||
if (! ARCH_USE_IMT) {
|
||||
interface_offsets [max_interface_id - interf->interface_id] = &pvt->vtable [slot];
|
||||
}
|
||||
pvt->interface_bitmap [interf->interface_id >> 3] |= (1 << (interf->interface_id & 7));
|
||||
|
||||
iter = NULL;
|
||||
j = 0;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
2007-08-14 Zoltan Varga <[email protected]>
|
||||
|
||||
* tramp-amd64.c (mono_arch_nullify_class_init_trampoline): Fix
|
||||
detection of call <REG> instruction sequence. Fixes build on freebsd.
|
||||
|
||||
2007-08-10 Geoff Norton <[email protected]>
|
||||
|
||||
* tramp-x86.c: Remove some unneeded alignment changes on Apple. Fixes #82387.
|
||||
|
||||
2007-08-03 Zoltan Varga <[email protected]>
|
||||
|
||||
* mini-amd64.h (MONO_INIT_CONTEXT_FROM_FUNC): Avoid using
|
||||
__builtin_frame_address () since it is broken on older gcc versions.
|
||||
|
||||
Thu Aug 2 17:36:22 CEST 2007 Paolo Molaro <[email protected]>
|
||||
|
||||
* mini-ppc.c: avoid an invalid encoding of unsigned right shift by 0
|
||||
to be emitted (bug #82281).
|
||||
|
||||
Tue Jul 24 21:16:17 CEST 2007 Paolo Molaro <[email protected]>
|
||||
|
||||
|
||||
@@ -182,11 +182,17 @@ typedef struct {
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
* __builtin_frame_address () is broken on some older gcc versions in the presence of
|
||||
* frame pointer elimination, see bug #82095.
|
||||
*/
|
||||
#define MONO_INIT_CONTEXT_FROM_FUNC(ctx,start_func) do { \
|
||||
int tmp; \
|
||||
guint64 stackptr = &tmp; \
|
||||
mono_arch_flush_register_windows (); \
|
||||
MONO_CONTEXT_SET_IP ((ctx), (start_func)); \
|
||||
MONO_CONTEXT_SET_BP ((ctx), __builtin_frame_address (0)); \
|
||||
MONO_CONTEXT_SET_SP ((ctx), __builtin_frame_address (0)); \
|
||||
MONO_CONTEXT_SET_BP ((ctx), stackptr); \
|
||||
MONO_CONTEXT_SET_SP ((ctx), stackptr); \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2381,7 +2381,10 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
|
||||
ppc_srawi (code, ins->dreg, ins->sreg1, (ins->inst_imm & 0x1f));
|
||||
break;
|
||||
case OP_SHR_UN_IMM:
|
||||
ppc_rlwinm (code, ins->dreg, ins->sreg1, (32 - (ins->inst_imm & 0x1f)), (ins->inst_imm & 0x1f), 31);
|
||||
if (ins->inst_imm)
|
||||
ppc_rlwinm (code, ins->dreg, ins->sreg1, (32 - (ins->inst_imm & 0x1f)), (ins->inst_imm & 0x1f), 31);
|
||||
else
|
||||
ppc_mr (code, ins->dreg, ins->sreg1);
|
||||
break;
|
||||
case CEE_SHR_UN:
|
||||
ppc_srw (code, ins->dreg, ins->sreg1, ins->sreg2);
|
||||
|
||||
@@ -124,7 +124,7 @@ mono_arch_nullify_class_init_trampoline (guint8 *code, gssize *regs)
|
||||
buf [2] = 0x90;
|
||||
buf [3] = 0x66;
|
||||
buf [4] = 0x90;
|
||||
} else if ((code [0] == 0x49) && (code [1] == 0xff)) {
|
||||
} else if ((code [0] == 0x41) && (code [1] == 0xff)) {
|
||||
/* call <REG> */
|
||||
/* amd64_set_reg_template is 10 bytes long */
|
||||
guint8* buf = code - 10;
|
||||
|
||||
@@ -255,11 +255,6 @@ mono_arch_create_trampoline_code (MonoTrampolineType tramp_type)
|
||||
pushed_args += 2;
|
||||
|
||||
/* starting the call sequence */
|
||||
#ifdef __APPLE__
|
||||
/* changing esp to keep the stack aligned */
|
||||
x86_alu_reg_imm (buf, X86_SUB, X86_ESP, 8);
|
||||
pushed_args += 2;
|
||||
#endif
|
||||
|
||||
/* FIXME: Push the trampoline address */
|
||||
x86_push_imm (buf, 0);
|
||||
@@ -303,12 +298,7 @@ mono_arch_create_trampoline_code (MonoTrampolineType tramp_type)
|
||||
else
|
||||
x86_call_code (buf, mono_magic_trampoline);
|
||||
|
||||
#ifdef __APPLE__
|
||||
/* account for the alignment above */
|
||||
x86_alu_reg_imm (buf, X86_ADD, X86_ESP, 6*4);
|
||||
#else
|
||||
x86_alu_reg_imm (buf, X86_ADD, X86_ESP, 4*4);
|
||||
#endif
|
||||
|
||||
/* restore LMF start */
|
||||
/* ebx = previous_lmf */
|
||||
|
||||
@@ -102,7 +102,6 @@ free_chunklist (CodeChunk *chunk)
|
||||
chunk = chunk->next;
|
||||
if (dead->flags == CODE_FLAG_MMAP) {
|
||||
mono_vfree (dead->data, dead->size);
|
||||
valgrind_unregister(dead->data);
|
||||
} else if (dead->flags == CODE_FLAG_MALLOC) {
|
||||
free (dead->data);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user