@@ -183,34 +183,36 @@ FCIMPL3(VOID, MarshalNative::PtrToStructureHelper, LPVOID ptr, Object* pObjIn, C
183
183
CONTRACTL_END;
184
184
185
185
OBJECTREF pObj = ObjectToOBJECTREF (pObjIn);
186
+
187
+ HELPER_METHOD_FRAME_BEGIN_1 (pObj);
186
188
187
189
if (ptr == NULL )
188
- FCThrowArgumentNullVoid (W (" ptr" ));
190
+ COMPlusThrowArgumentNull (W (" ptr" ));
189
191
if (pObj == NULL )
190
- FCThrowArgumentNullVoid (W (" structure" ));
192
+ COMPlusThrowArgumentNull (W (" structure" ));
191
193
192
194
// Code path will accept regular layout objects.
193
195
MethodTable *pMT = pObj->GetMethodTable ();
194
196
195
197
// Validate that the object passed in is not a value class.
196
198
if (!allowValueClasses && pMT->IsValueType ())
197
199
{
198
- FCThrowArgumentVoid (W (" structure" ), W (" Argument_StructMustNotBeValueClass" ));
200
+ COMPlusThrowArgumentException (W (" structure" ), W (" Argument_StructMustNotBeValueClass" ));
199
201
}
200
202
else if (pMT->IsBlittable ())
201
203
{
202
204
memcpyNoGCRefs (pObj->GetData (), ptr, pMT->GetNativeSize ());
203
205
}
204
206
else if (pMT->HasLayout ())
205
207
{
206
- HELPER_METHOD_FRAME_BEGIN_1 (pObj);
207
- LayoutUpdateCLR ((LPVOID*) &(pObj), Object::GetOffsetOfFirstField (), pMT, (LPBYTE)(ptr));
208
- HELPER_METHOD_FRAME_END ();
208
+ LayoutUpdateCLR ((LPVOID*) &(pObj), Object::GetOffsetOfFirstField (), pMT, (LPBYTE)(ptr));
209
209
}
210
210
else
211
211
{
212
- FCThrowArgumentVoid (W (" structure" ), W (" Argument_MustHaveLayoutOrBeBlittable" ));
213
- }
212
+ COMPlusThrowArgumentException (W (" structure" ), W (" Argument_MustHaveLayoutOrBeBlittable" ));
213
+ }
214
+
215
+ HELPER_METHOD_FRAME_END ();
214
216
}
215
217
FCIMPLEND
216
218
0 commit comments