size_t should not map to uint. It should rather map to UIntPtr (64 bit on 64 bit machines, 32 bit on 32 bit machines).