示例#1
0
        public static ServiceManagerApi.LW_SERVICE_INFO UnmarshalServiceInfo(IntPtr pNativeData)
        {
            _LW_SERVICE_INFO _info = (_LW_SERVICE_INFO)Marshal.PtrToStructure(pNativeData, typeof(_LW_SERVICE_INFO));

            ServiceManagerApi.LW_SERVICE_INFO info = new ServiceManagerApi.LW_SERVICE_INFO();

            info.type              = _info.type;
            info.pwszName          = _info.pwszName;
            info.pwszPath          = _info.pwszPath;
            info.pwszDescription   = _info.pwszDescription;
            info.bAutostart        = _info.bAutostart;
            info.ppwszArgs         = ServiceManagerInterop.UnmarshalStringList(_info.ppwszArgs);
            info.ppwszDependencies = ServiceManagerInterop.UnmarshalStringList(_info.ppwszDependencies);

            return(info);
        }
示例#2
0
 object ICustomMarshaler.MarshalNativeToManaged(IntPtr pNativeData)
 {
     return(ServiceManagerInterop.UnmarshalStringList(pNativeData));
 }