convert tcbdb.c to native win32 api