Netapi32.dll Error

0 views
Skip to first unread message

Pierpont Oldham

unread,
Aug 4, 2024, 1:23:41 PM8/4/24
to almagafo
Fortectis particularly beneficial if the Windows Registry is broken because Windows does not have an automated repair feature. It also gives a system summary, which can reveal if there are issues with hardware.

A restore point is a saved copy of how your Windows system was configured at a previous point in time. Going back to a date before the NetAPI32.dll error will usually repair the problem. However, it will also rollback other user settings too.


So at this point I can't run dmt.exe, but I still have the newer replacement version of netapi32.dll on my system, and it seems to be running fine with it. So I'm wondering if there is an even newer version of that file that is known to be compatible with win-98. (I have no idea what netapi32.dll is for or how important it is).


Well, I can say that on this win-98se system (with KernelEx 3.6) that version 5.00.2194.1 of netapi32.dll causes no apparent system instability or problems. If the file info is correct, that file is from win-2k. It's significantly larger than the original version (303kb vs 20kb). I'll try this same file on my office win-98 system (without KernelEx) where it's "windows network" LAN functionality would presumably be more heavily used.


Well, I tried version 5.00.2194.1 of netapi32.dll on my win-98se office computer. Unlike my home PC, my office PC wouldn't let me mess with the file while windows was running, so I had to swap the file while booted into DOS. Upon restart, my system performed auto-logon into our NT-controlled domain, and I had full access to our internal LAN and the various shares on NT and XP machines. In other words, this version of netapi32.dll worked just fine.


Anyway, I managed to find the ME version of NETAPI32.DLL (as you've suggested here), but alas, this produced the same error as the 98SE version. Looks like this problem needs a "NetApi32Ex" kinda solution.


...Okay, a brute-force search of my entire 30GB HDD just now found a program named winbox.exe that is static-linked to Netapi32.Netbios. But none linked to the NT Netapi32 functions. I'll do some testing and report back....


Errors related to netapi32.dll can arise for a few different different reasons. For instance, a faulty application, netapi32.dll has been deleted or misplaced, corrupted by malicious software present on your PC or a damaged Windows registry.


In the vast majority of cases, the solution is to properly reinstall netapi32.dll on your PC, to the Windows system folder. Alternatively, some programs, notably PC games, require that the DLL file is placed in the game/application installation folder.


Do you have information that we do not?

Did our advice help or did we miss something?

Our Forum is where you can get help from both qualified tech specialists and the community at large. Sign up, post your questions, and get updates straight to your inbox.


I'm using NetGroupGetUser api (from netapi32.dll) to retrive names and data of the domain users. It worked well for a while, but now (maybe some recent Windows Updates), in win64 applications, it returns me strange results or access violations. Same code compiled in Win32 instead always worked fine. Attached is a sample that I've found online (stackoverflow) that I'm using to do some tests. The original program was designed to retrieve data in buffers (1024byte). Doing that, in my case, if users number exceeds the buffer, the second call of NetGroupGetUser raise an access violation in samlib.dll (running on a Windows 2019 server). I've solved calling the api once using MAX_PREFERRED_LENGTH (=DWORD(-1)) instead of the original 1024 byte buffer size. I could not find documentation about differences in declaring the api for win32 or win64... It seems some kind of mess with the api parameters in 64 bit or a bug of 64bit version of netapi32.dll.


Yes I'm working as admin so I can run without elevation. I suppose you have several users in the domain so it need to call the api more than one time and on second call you get AV. It is the problem for which I started this topic. If you use the MAX_PREFERED_LENGHT version (comment/uncomment instructions) does it work? For me yes and some weeks ago worked also the original version..


I know that my english is terrible but I suppose you have misunderstood the reason of this topic. I'm not looking for someone to debug my super beatiful large and complex code written in the better way possible and bla bla... As I wrote, I've already solved the problem with the workaround that I have posted (it's not the best solution but it works) and now with @Lars Fosdal kind answers I also could try other modern ways to reach my goal (like AD apis).


Discover the cause of the acces violation could be maybe a good exercise for some Windows api guru. I've dedicated it some hours yesterday trying to change the way to declare the parameters of the api but I could not reach a solution. I've tried several combinations even going against what is stated in the api documentation. There is something strange tha I'm missing on that api because the totalentries out parameter is always a non sense value called in win64. In win32 works as apected. So maybe there is something not documented in the Windows api or maybe, as that api si considered very old, maybe the win64 part could be buggy (just a my guess) or maybe could be something wrong using it from a Delphi win64 program (I've tested it both 10.4.2 and 11.2 but the problem is the same).


Descarga el siguiente netapi32.dll para resolver tu problema dll. En este momento tenemos disponibles 16 versiones diferentes de este archivo.

Elige sabiamente. La mayora de las veces basta con elegir la versin ms alta.


Los errores relacionados con netapi32.dll pueden producirse por distintas razones. Por ejemplo, una aplicacin defectuosa, netapi32.dll, se ha eliminado o ubicado de forma incorrecta, ha sido corrompida por un software malicioso en tu PC o un registro de Windows daado.


En la mayora de los casos, la solucin consiste en volver a instalar adecuadamente netapi32.dll en tu PC, en la carpeta de sistema de Windows. Por otra parte, algunos programas, sobre todo los juegos para PC, requieren que el archivo de DLL se encuentre ubicado en la carpeta de instalacin del juego/aplicacin.


Tiene informacin que nosotros no?

Fueron de ayuda nuestros consejos o nos hemos perdido algo?

Nuestro foro es donde puede obtener ayuda de los especialistas cualificados tecnologa y la comunidad en general. Inscrbase, enve sus preguntas, y obtenga actualizaciones directamente en su bandeja de entrada.




What you try to do is entirely legal and works normally. What is the

last error immediately after the failing call to LoadLibrary? You get

the threads last error by calling GetLastError().

--

S




> What you try to do is entirely legal and works normally. What is the last

> error immediately after the failing call to LoadLibrary? You get the threads

> last error by calling GetLastError().


It's 2, ERROR file not foundIt returns the same error if I copy the 32 bit DLL to the same

subdirectory. I suppose it could be missing one of the DLLs in its

dependancy list, but I don't know why it would, this is a fresh install.Erick




Then a DLL on which netapi32 is dependent is missing. Did you mess

around with the PATH environment variable, either for your computer or

for your process?And as Timo wrote, the profiling feature of depends.exe comes in handy,

and also running Process Monitor, while your call fails.--

S




> Then a DLL on which netapi32 is dependent is missing. Did you mess around

> with the PATH environment variable, either for your computer or for your

> process?

>

> And as Timo wrote, the profiling feature of depends.exe comes in handy, and

> also running Process Monitor, while your call fails.


I found the reason I was running into this, I was running the application

from my network drive (where I compiled it). Copying it to the C: drive

caused windows to work as expected.I didn't try searching MSDN as to why that happens. It's not a nice

effect, we teach our students to compile on the network drive where

everything is backed up.Erick




This can hardly be the reason for this behaviour. Running an app from a

network drive doesn't change the Loader behaviour. I suspect that it is

something entirely different. Did you get any results from running your

app inside depends.exe, as Timo suggested, or did running Process

Monitor yield any results?Do you have any "Security Solution" running that maybe prevents apps

from running from a network drive if they load DLLs that do networking?

Maybe Software Restriction Policies?--

S






> This can hardly be the reason for this behaviour. Running an app from a

> network drive doesn't change the Loader behaviour. I suspect that it is

> something entirely different. Did you get any results from running your app

> inside depends.exe, as Timo suggested, or did running Process Monitor yield

> any results?

>

> Do you have any "Security Solution" running that maybe prevents apps from

> running from a network drive if they load DLLs that do networking? Maybe

> Software Restriction Policies?


Actually, the depends program wouldn't load from the network drive either.

When I copied both to the local drive, both depends and my program worked

perfectly.This is not as outrageous as it sounds. Starting in Vista, exe files on

the network drive would sometimes raise warnings before executing as

though they had been downloaded with IE (they weren't). The network drive

was Samba in both cases, I haven't tried it with a Windows file server.ERick



3a8082e126
Reply all
Reply to author
Forward
0 new messages