// doLoadDLL tries to load the dokan DLL from various locations.
431144
func doLoadDLL(epc *errorPrinter, path string) (windows.Handle, error) {
	var guessPath bool
	epc.Printf("loadDokanDLL %q\n", path)
	if path == "" {
		path = shortPath
		guessPath = true
	} else {
		path = filepath.FromSlash(path)
	}
	const loadLibrarySearchSystem32 = 0x800
	const flags = loadLibrarySearchSystem32
	hdl, err := windows.LoadLibraryEx(path, 0, flags)
	epc.Printf("loadDokanDLL LoadLibraryEx(%q,0,%x) -> %v,%v\n", path, flags, hdl, err)
	if err == nil || !guessPath {
		return hdl, err
	}
	// User probably has not installed KB2533623 which is a security update
	// from 2011. Without this Windows security update loading libraries
	// is unsafe on Windows.
	// Continue to try to load the DLL regardless.

	if runtime.GOARCH == `386` {
		hdl, err = loadLibrary(epc, syswow64+shortPath)
		if err == nil {
			return hdl, nil
		}
	}
	hdl, err = loadLibrary(epc, system32+shortPath)
	if err == nil {
		return hdl, nil
	}
	hdl, err = loadLibrary(epc, shortPath)
	if err == nil {
		return hdl, nil
	}
	err = fmt.Errorf("loadDokanDLL: cannot load Dokan DLL: %v", err)
	epc.Printf("ERROR: %v\n", err)
	return 0, err
}
1335831
func (c *Client) LoadPlugin(p []string) *LoadPluginResult {
	r := new(LoadPluginResult)
	resp, err := c.pluginUploadRequest(p)
	if err != nil {
		r.Err = serror.New(err)
		return r
	}

	switch resp.Meta.Type {
	case rbody.PluginsLoadedType:
		pl := resp.Body.(*rbody.PluginsLoaded)
		r.LoadedPlugins = convertLoadedPlugins(pl.LoadedPlugins)
	case rbody.ErrorType:
		f := resp.Body.(*rbody.Error).Fields
		fields := make(map[string]interface{})
		for k, v := range f {
			fields[k] = v
		}
		r.Err = serror.New(resp.Body.(*rbody.Error), fields)
	default:
		r.Err = serror.New(ErrAPIResponseMetaType)
	}
	return r
}
336562
func LoadDDLVars(ctx sessionctx.Context) error {
	return LoadGlobalVars(ctx, []string{variable.TiDBDDLErrorCountLimit})
}
33447
func LoadModule(dir string) (*tfconfig.Module, tfdiags.Diagnostics) {
	mod, diags := tfconfig.LoadModule(dir)
	return mod, wrapDiagnostics(diags)
}
1048156
func Load(der []byte) (*Data, error) {
	var err error

	d := new(Data)
	d.Cert, err = x509.ParseCertificate(der)
	if err != nil {
		return nil, err
	}

	if err = d.setCertificateType(); err != nil {
		fmt.Println(err)
	}

	return d, nil
}
1187160
func (c *Config) LoadIteratorToDepth(ctx context.Context, qs graph.QuadStore, dst reflect.Value, depth int, list graph.Iterator) error {
	if depth >= 0 {
		// 0 depth means "current level only" for user, but it's easier to make depth=0 a stop condition
		depth++
	}
	l := c.newLoader(qs)
	return l.loadIteratorToDepth(ctx, dst, depth, list)
}
314799
func (l *CertificateStoreLookup) LoadCRLFile(crl_file string) error {
	runtime.LockOSThread()
	defer runtime.UnlockOSThread()
	var c_crl_file *C.char
	if crl_file != "" {
		c_crl_file = C.CString(crl_file)
		defer C.free(unsafe.Pointer(c_crl_file))
	}
	if int(C.X509_load_crl_file(l.lookup, c_crl_file, C.X509_FILETYPE_PEM)) != 1 {
		return errorFromErrorQueue()
	}
	return nil
}
882538
func loadFile(path string, overload bool) error {
	env, err := ReadFile(path)
	if err != nil {
		return err
	}
	LoadMap(env, overload)
	return nil
}
867719
func doList(clnt Client, isRecursive, isIncomplete bool) error {
	prefixPath := clnt.GetURL().Path
	separator := string(clnt.GetURL().Separator)
	if !strings.HasSuffix(prefixPath, separator) {
		prefixPath = prefixPath[:strings.LastIndex(prefixPath, separator)+1]
	}
	var cErr error
	for content := range clnt.List(isRecursive, isIncomplete, DirNone) {
		if content.Err != nil {
			switch content.Err.ToGoError().(type) {
			// handle this specifically for filesystem related errors.
			case BrokenSymlink:
				errorIf(content.Err.Trace(clnt.GetURL().String()), "Unable to list broken link.")
				continue
			case TooManyLevelsSymlink:
				errorIf(content.Err.Trace(clnt.GetURL().String()), "Unable to list too many levels link.")
				continue
			case PathNotFound:
				errorIf(content.Err.Trace(clnt.GetURL().String()), "Unable to list folder.")
				continue
			case PathInsufficientPermission:
				errorIf(content.Err.Trace(clnt.GetURL().String()), "Unable to list folder.")
				continue
			case ObjectOnGlacier:
				errorIf(content.Err.Trace(clnt.GetURL().String()), "")
				continue
			}
			errorIf(content.Err.Trace(clnt.GetURL().String()), "Unable to list folder.")
			cErr = exitStatus(globalErrorExitStatus) // Set the exit status.
			continue
		}
		// Convert any os specific delimiters to "/".
		contentURL := filepath.ToSlash(content.URL.Path)
		prefixPath = filepath.ToSlash(prefixPath)

		// Trim prefix of current working dir
		prefixPath = strings.TrimPrefix(prefixPath, "."+separator)
		// Trim prefix path from the content path.
		contentURL = strings.TrimPrefix(contentURL, prefixPath)
		content.URL.Path = contentURL
		parsedContent := parseContent(content)
		// Print colorized or jsonized content info.
		printMsg(parsedContent)
	}
	return cErr
}
448456
func (l hcl2Loader) loadFile(filename string) (configurable, []string, error) {
	var f *hcl2.File
	var diags hcl2.Diagnostics
	if strings.HasSuffix(filename, ".json") {
		f, diags = l.Parser.ParseJSONFile(filename)
	} else {
		f, diags = l.Parser.ParseHCLFile(filename)
	}
	if diags.HasErrors() {
		// Return diagnostics as an error; callers may type-assert this to
		// recover the original diagnostics, if it doesn't end up wrapped
		// in another error.
		return nil, nil, diags
	}

	return &hcl2Configurable{
		SourceFilename: filename,
		Body:           f.Body,
	}, nil, nil
}
775152
func (lb *loadBalancer) checkLoadBalancerRule(lbRuleName string, port v1.ServicePort) (bool, bool, error) {
	lbRule, ok := lb.rules[lbRuleName]
	if !ok {
		return false, false, nil
	}

	// Check if any of the values we cannot update (those that require a new load balancer rule) are changed.
	if lbRule.Publicip == lb.ipAddr && lbRule.Privateport == strconv.Itoa(int(port.NodePort)) && lbRule.Publicport == strconv.Itoa(int(port.Port)) {
		return true, lbRule.Algorithm != lb.algorithm, nil
	}

	// Delete the load balancer rule so we can create a new one using the new values.
	if err := lb.deleteLoadBalancerRule(lbRule); err != nil {
		return false, false, err
	}

	return false, false, nil
}
1125951
func (s *UploadMetadata) SetUploadUrl(v string) *UploadMetadata {
	s.UploadUrl = &v
	return s
}
1072248
func (l *tomlLoader) Load(out interface{}) error {
	if _, err := toml.DecodeReader(l.r, out); err != nil {
		return err
	}
	return nil
}
1081819
func LoadToDepth(ctx context.Context, qs graph.QuadStore, dst interface{}, depth int, ids ...quad.Value) error {
	return global.LoadToDepth(ctx, qs, dst, depth, ids...)
}
99408
func (d *DL) Close() error {
	if d.handle != nil {
		d.mu.Lock()
		defer d.mu.Unlock()
		if d.handle != nil {
			mu.Lock()
			defer mu.Unlock()
			if C.dlclose(d.handle) != 0 {
				return dlerror()
			}
			d.handle = nil
		}
	}
	return nil
}
648067
func doREPL(L *lua.LState) {
	rl, err := readline.New("> ")
	if err != nil {
		panic(err)
	}
	defer rl.Close()
	for {
		if str, err := loadline(rl, L); err == nil {
			if err := L.DoString(str); err != nil {
				fmt.Println(err)
			}
		} else { // error on loadline
			fmt.Println(err)
			return
		}
	}
}
163560
func Loader(L *lua.LState) int {

	// register functions to the table
	mod := L.SetFuncs(L.NewTable(), exports)

	// set up meta table
	mt := L.NewTable()
	L.SetField(mt, "__index", L.NewClosure(moduleIndex))
	L.SetField(mt, "__call", L.NewClosure(moduleCall))
	L.SetMetatable(mod, mt)

	shMetaTable := L.NewTypeMetatable(luaShTypeName)
	L.SetField(shMetaTable, "__call", L.NewFunction(shCall))
	L.SetField(shMetaTable, "__index", L.NewFunction(shIndex))

	// returns the module
	L.Push(mod)
	return 1
}