saneeha.nust 0 Light Poster

I am using the function CryptProtectData() to generate an encryption key...

I have made a DATA_BLOB structure, and made two instances of it. The code
is as follows:

private struct DATA_BLOB
        {
            public int cbData;
            public IntPtr pbData;
        }

            DATA_BLOB pDataIn;
            pDataIn.cbData = 2;
            pDataIn.pbData = Marshal.StringToHGlobalUni("saneeha");
            DATA_BLOB pdataOut;


CryptProtectData(pDataIn,"sasa",null,(IntPtr)null,null,CryptProtectFlags.CRYPTPROTECT_LOCAL_MACHINE,pdataOut);

But it gives error that the function has some invalid arguments....plz
guide me why I am getting this error....??