c - status failed for LdrLoadDll -


I'am trying to work I am no luck with out LdrLoadDll function and that ... I Googled for some examples, there is no more document or exact example about this. I know what it really does..Please check the code given below.

  // declaration function pointer for LdrLoadDll typedef NTSTATUS (_stdcall * fp_LdrLoadDll) (PWCHAR PathToFile in the OPTIONAL, optional flags, PUNICODE_STRING ModuleFileName, out out modules); Calling LdrLoadDll using // getprocaddress handle handle; HMODULE Module = Load Library (L "ntdll.dll"); Fp_LdrLoadDll loadDll; LoadDll = (fp_LdrLoadDll) GetProcAddress (module, "LDRLoadDll"); If (loadDll == NULL) {messageBox (0, L "function is not able to load" L "Eldiarloddl", and handle); } UNICODE_STRING input; Input. Buffer = l "c: \\ desktop \\ myDll.dll"; Input.Length = wcslen (input.Buffer) * 2; Input.MaximumLength = wcslen (input.Buffer) +2; NTSTATUS status = loadDll (NULL, LOAD_WITH_ALTERED_SEARCH_PATH, and input, 0);  

When I execute the above, there is no valid status for handling. Please help me with it.

It works for me when I intialized the following way Unicode string

  RtlInitUnicodeString (& amp; Input, l "myDll.dll");  

Comments