| 38 | } |
| 39 | |
| 40 | mscorlib::_MethodInfoPtr DotNetInterop::GetStaticMethodLoad(mscorlib::_TypePtr type, LPCWSTR methodName, int pcount) { |
| 41 | |
| 42 | LPSAFEARRAY methods = type->GetMethods_2(); |
| 43 | mscorlib::_MethodInfoPtr ret; |
| 44 | LONG methodCount = GetSafeArrayLen(methods); |
| 45 | int choose = 0; |
| 46 | for (long i = 0; i < methodCount; ++i) |
| 47 | { |
| 48 | IUnknown* v = nullptr; |
| 49 | |
| 50 | if (SUCCEEDED(SafeArrayGetElement(methods, &i, &v))) |
| 51 | { |
| 52 | mscorlib::_MethodInfoPtr method = v; |
| 53 | bstr_t name = method->Getname(); |
| 54 | LPSAFEARRAY params = method->GetParameters(); |
| 55 | long paramCount = GetSafeArrayLen(params); |
| 56 | |
| 57 | if (method->IsStatic && wcscmp(name.GetBSTR(), methodName) == 0 && paramCount == pcount) |
| 58 | { |
| 59 | if (choose == 2) |
| 60 | { |
| 61 | ret = method; |
| 62 | |
| 63 | break; |
| 64 | } |
| 65 | choose += 1; |
| 66 | |
| 67 | } |
| 68 | |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | SafeArrayDestroy(methods); |
| 73 | |
| 74 | return ret; |
| 75 | } |
nothing calls this directly
no test coverage detected