... or lpSecurityAttributes AS LONGLONG // for 64 bits When you call the function, that parameter will be LPSECURITY_ATTRIBUTES() as such parameter is declared by Microsoft like this: [in, optional] LPSECURITY_ATTRIBUTES lpSecurityAttributes, it may work also if you supply a zero as the parameter value ...