did you look at the example in msdn? https://msdn.microsoft.com/en-us/library/windows/desktop/aa365261(v=vs.85).aspx
why didnt windows api functions that are meant to do exactly thus did not work for you?
maybe converting to csv, adding what you need and converting back can help?
is the code for python2 or 3?