Git Product home page Git Product logo

ntstyle's People

Contributors

freedom7341 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

bhty ven-ox kawapure

ntstyle's Issues

Code quality in srchook/ntsdlfn.c

Hello, I was looking through the code in srchook/ntsdlfn.c, which temporarily loads a few DWM API functions in during runtime, and have a few questions about the existing design. Notably, I believe that the existing code has a tiny resource leak in successful instances.

Current code is structured something like this for both function imports:

HMODULE hLib = LoadLibrary(L"Dwmapi.dll");
HRESULT hRet = 0;

if (hLib)
{
	FARPROC fLib = GetProcAddress(hLib, <FUNCTION>);
	if (hRet = (HRESULT)fLib(<ARGUMENTS>))
	{
		FreeLibrary(hLib);
		return hRet;
	}
}

return 0;

I believe that the FreeLibrary call should be ran in both cases. Otherwise, what would happen here is that the library is loaded by the application and never freed. Note that S_OK (a successful HRESULT) is equal to 0, so the if condition is passed and the function always returns successful if hRet is 0, without freeing the library. In general, the macros SUCCEEDED() or FAILED() should be used for HRESULTs, for clarity.

If this is the intended behaviour, then it'd be good to add a comment documenting this. Otherwise, appropriate adjustments should be made.

Problem opening the executable after compilation.

When I try to open the executable (ntstyle.exe), the process appears in the task manager for a second, then disappears.
I used Visual Studio Build Tool 2022 for the compilation; the compilation did not encounter any errors, but there may be a parameter that I forget to enter.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.