Yes, it is possible, and there are many Open and Closed source alternatives out there, but they all have their own drawbacks and advantages. I would strongly suggest using a developed implementation than to try and write your own, after all, why re-invent the wheel yet again? It is also likely to be much more stable out of the box than your own developed app as they have had plenty of time to work out all the crashes that messing with gina can cause.
One of the more well known ones is pgina. Highlights are:
LDAP, MySQL, Local SAM, Email and other plugins included out of the box
100% managed code Plugin API Extended and Enhanced Plugin API allows for multiple plugins and additional features
Supports all Windows plaftorms, from XP SP3 through Windows 8 Developer Preview, x86 and x64 - all from a single installer Enhanced stability, improved memory usage and modern standards and practices based code base
Without more information about what you actually want and how you intend to implement it, there is no possible way to elaborate any further. In general though, it is possible, but not a very good idea to mess with unless you have a good reason and know precisely what you are doing, otherwise you will open your computer (and network) to security threats and possibly create a very unstable (or unusable) system.